diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2011-08-14 18:57:49 +0000 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2011-08-14 18:57:49 +0000 |
commit | e79fca992c7b57eb82969af3265de421f397fda2 (patch) | |
tree | 25141797831ca36467a2bb061b3692bfe9f74ce2 /utils | |
parent | 2c07d238db2afbc2c0b9a1fa166549addf3be711 (diff) | |
download | rockbox-e79fca992c7b57eb82969af3265de421f397fda2.tar.gz rockbox-e79fca992c7b57eb82969af3265de421f397fda2.zip |
Remove use of which.py module.
Implement simple which functionality. This has less features than which.py but
is sufficient, and removing an external dependency is always good.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30315 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/common/deploy.py | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/utils/common/deploy.py b/utils/common/deploy.py index 74dfab420c..6a8b2580da 100755 --- a/utils/common/deploy.py +++ b/utils/common/deploy.py | |||
@@ -29,7 +29,6 @@ | |||
29 | # If the required Qt installation isn't in PATH use --qmake option. | 29 | # If the required Qt installation isn't in PATH use --qmake option. |
30 | # Tested on Linux and MinGW / W32 | 30 | # Tested on Linux and MinGW / W32 |
31 | # | 31 | # |
32 | # requires python which package (http://code.google.com/p/which/) | ||
33 | # requires pysvn package. | 32 | # requires pysvn package. |
34 | # requires upx.exe in PATH on Windows. | 33 | # requires upx.exe in PATH on Windows. |
35 | # | 34 | # |
@@ -54,12 +53,6 @@ except ImportError: | |||
54 | print "Fatal: This script requires the pysvn package to run." | 53 | print "Fatal: This script requires the pysvn package to run." |
55 | print " See http://pysvn.tigris.org/." | 54 | print " See http://pysvn.tigris.org/." |
56 | sys.exit(-5) | 55 | sys.exit(-5) |
57 | try: | ||
58 | import which | ||
59 | except ImportError: | ||
60 | print "Fatal: This script requires the which package to run." | ||
61 | print " See http://code.google.com/p/which/." | ||
62 | sys.exit(-5) | ||
63 | cpus = 1 | 56 | cpus = 1 |
64 | try: | 57 | try: |
65 | import multiprocessing | 58 | import multiprocessing |
@@ -109,6 +102,16 @@ def usage(myself): | |||
109 | print " from svn." | 102 | print " from svn." |
110 | 103 | ||
111 | 104 | ||
105 | def which(executable): | ||
106 | path = os.environ.get("PATH", "").split(os.pathsep) | ||
107 | for p in path: | ||
108 | fullpath = p + "/" + executable | ||
109 | if os.path.exists(fullpath): | ||
110 | return fullpath | ||
111 | print "which: could not find " + executable | ||
112 | return "" | ||
113 | |||
114 | |||
112 | def getsources(svnsrv, filelist, dest): | 115 | def getsources(svnsrv, filelist, dest): |
113 | '''Get the files listed in filelist from svnsrv and put it at dest.''' | 116 | '''Get the files listed in filelist from svnsrv and put it at dest.''' |
114 | client = pysvn.Client() | 117 | client = pysvn.Client() |
@@ -160,7 +163,7 @@ def findqt(cross=""): | |||
160 | bins = [cross + "qmake", cross + "qmake-qt4"] | 163 | bins = [cross + "qmake", cross + "qmake-qt4"] |
161 | for binary in bins: | 164 | for binary in bins: |
162 | try: | 165 | try: |
163 | q = which.which(binary) | 166 | q = which(binary) |
164 | if len(q) > 0: | 167 | if len(q) > 0: |
165 | result = checkqt(q) | 168 | result = checkqt(q) |
166 | if not result == "": | 169 | if not result == "": |
@@ -346,7 +349,7 @@ def finddlls(program, extrapaths=[], cross=""): | |||
346 | break | 349 | break |
347 | if dllpath == "": | 350 | if dllpath == "": |
348 | try: | 351 | try: |
349 | dllpath = re.sub(r"\\", r"/", which.which(file)) | 352 | dllpath = re.sub(r"\\", r"/", which(file)) |
350 | print file + ": found at " + dllpath | 353 | print file + ": found at " + dllpath |
351 | dllpaths.append(dllpath) | 354 | dllpaths.append(dllpath) |
352 | except: | 355 | except: |