From 6bb3802bc57ed237137e4880b42edbdd23ce3440 Mon Sep 17 00:00:00 2001 From: "scherkus@chromium.org" Date: Wed, 28 Oct 2009 22:23:19 +0000 Subject: Fix checkbins.py to find pefile import instead of .bat/.sh wrappers. BUG=25952 TEST=still executes regardless of where you run the script from Review URL: http://codereview.chromium.org/347008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30396 0039d316-1c4b-4281-b951-d872f2087c98 --- tools/checkbins/checkbins.bat | 5 +---- tools/checkbins/checkbins.py | 3 +++ tools/checkbins/checkbins.sh | 9 --------- 3 files changed, 4 insertions(+), 13 deletions(-) delete mode 100755 tools/checkbins/checkbins.sh (limited to 'tools') diff --git a/tools/checkbins/checkbins.bat b/tools/checkbins/checkbins.bat index 8e7c001..d7debd1 100755 --- a/tools/checkbins/checkbins.bat +++ b/tools/checkbins/checkbins.bat @@ -1,4 +1 @@ -@echo off -setlocal -set PYTHONPATH=%~dp0..\..\third_party\pefile;%PYTHONPATH% -%~dp0..\..\third_party\python_24\python.exe %~dp0checkbins.py %* +@%~dp0..\..\third_party\python_24\python.exe %~dp0checkbins.py %* diff --git a/tools/checkbins/checkbins.py b/tools/checkbins/checkbins.py index 318720e..a662a02 100755 --- a/tools/checkbins/checkbins.py +++ b/tools/checkbins/checkbins.py @@ -14,6 +14,9 @@ import os import optparse import sys +# Find /third_party/pefile based on current directory and script path. +sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', + 'third_party', 'pefile')) import pefile PE_FILE_EXTENSIONS = ['.exe', '.dll'] diff --git a/tools/checkbins/checkbins.sh b/tools/checkbins/checkbins.sh deleted file mode 100755 index e0e3bd1..0000000 --- a/tools/checkbins/checkbins.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -# Copyright (c) 2009 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# Include pefile in the path. -PYTHONPATH="$(dirname $0)/../../third_party/pefile:$PYTHONPATH" -export PYTHONPATH -python "$(dirname $0)/checkbins.py" "$@" -- cgit v1.1