forked from len0rd/rockbox
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
This commit is contained in:
parent
2c07d238db
commit
e79fca992c
1 changed files with 12 additions and 9 deletions
|
@ -29,7 +29,6 @@
|
||||||
# If the required Qt installation isn't in PATH use --qmake option.
|
# If the required Qt installation isn't in PATH use --qmake option.
|
||||||
# Tested on Linux and MinGW / W32
|
# Tested on Linux and MinGW / W32
|
||||||
#
|
#
|
||||||
# requires python which package (http://code.google.com/p/which/)
|
|
||||||
# requires pysvn package.
|
# requires pysvn package.
|
||||||
# requires upx.exe in PATH on Windows.
|
# requires upx.exe in PATH on Windows.
|
||||||
#
|
#
|
||||||
|
@ -54,12 +53,6 @@ except ImportError:
|
||||||
print "Fatal: This script requires the pysvn package to run."
|
print "Fatal: This script requires the pysvn package to run."
|
||||||
print " See http://pysvn.tigris.org/."
|
print " See http://pysvn.tigris.org/."
|
||||||
sys.exit(-5)
|
sys.exit(-5)
|
||||||
try:
|
|
||||||
import which
|
|
||||||
except ImportError:
|
|
||||||
print "Fatal: This script requires the which package to run."
|
|
||||||
print " See http://code.google.com/p/which/."
|
|
||||||
sys.exit(-5)
|
|
||||||
cpus = 1
|
cpus = 1
|
||||||
try:
|
try:
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
|
@ -109,6 +102,16 @@ def usage(myself):
|
||||||
print " from svn."
|
print " from svn."
|
||||||
|
|
||||||
|
|
||||||
|
def which(executable):
|
||||||
|
path = os.environ.get("PATH", "").split(os.pathsep)
|
||||||
|
for p in path:
|
||||||
|
fullpath = p + "/" + executable
|
||||||
|
if os.path.exists(fullpath):
|
||||||
|
return fullpath
|
||||||
|
print "which: could not find " + executable
|
||||||
|
return ""
|
||||||
|
|
||||||
|
|
||||||
def getsources(svnsrv, filelist, dest):
|
def getsources(svnsrv, filelist, dest):
|
||||||
'''Get the files listed in filelist from svnsrv and put it at dest.'''
|
'''Get the files listed in filelist from svnsrv and put it at dest.'''
|
||||||
client = pysvn.Client()
|
client = pysvn.Client()
|
||||||
|
@ -160,7 +163,7 @@ def findqt(cross=""):
|
||||||
bins = [cross + "qmake", cross + "qmake-qt4"]
|
bins = [cross + "qmake", cross + "qmake-qt4"]
|
||||||
for binary in bins:
|
for binary in bins:
|
||||||
try:
|
try:
|
||||||
q = which.which(binary)
|
q = which(binary)
|
||||||
if len(q) > 0:
|
if len(q) > 0:
|
||||||
result = checkqt(q)
|
result = checkqt(q)
|
||||||
if not result == "":
|
if not result == "":
|
||||||
|
@ -346,7 +349,7 @@ def finddlls(program, extrapaths=[], cross=""):
|
||||||
break
|
break
|
||||||
if dllpath == "":
|
if dllpath == "":
|
||||||
try:
|
try:
|
||||||
dllpath = re.sub(r"\\", r"/", which.which(file))
|
dllpath = re.sub(r"\\", r"/", which(file))
|
||||||
print file + ": found at " + dllpath
|
print file + ": found at " + dllpath
|
||||||
dllpaths.append(dllpath)
|
dllpaths.append(dllpath)
|
||||||
except:
|
except:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue