mirror of
https://github.com/kennethreitz-archive/pyinstaller.git
synced 2026-06-05 23:50:17 +00:00
Some additional fixes to make UPX paths work correctly.
git-svn-id: http://svn.pyinstaller.org/trunk@666 8dd32b29-ccff-0310-8a9a-9233e24343b1
This commit is contained in:
@@ -51,6 +51,14 @@ rthooks = {}
|
||||
iswin = sys.platform[:3] == 'win'
|
||||
cygwin = sys.platform == 'cygwin'
|
||||
|
||||
def system(cmd):
|
||||
# This workaround is required because NT shell doesn't work with commands
|
||||
# that start with double quotes (required if there are spaces inside the
|
||||
# command path)
|
||||
if iswin:
|
||||
cmd = 'echo on && ' + cmd
|
||||
os.system(cmd)
|
||||
|
||||
def _save_data(filename, data):
|
||||
outf = open(filename, 'w')
|
||||
pprint.pprint(data, outf)
|
||||
@@ -492,13 +500,13 @@ def checkCache(fnm, strip, upx):
|
||||
upx_executable = "upx"
|
||||
if config.get('upx_dir'):
|
||||
upx_executable = os.path.join(config['upx_dir'], upx_executable)
|
||||
cmd = upx_executable + " " + bestopt + " -q \"%s\"" % cachedfile
|
||||
cmd = '"' + upx_executable + '" ' + bestopt + " -q \"%s\"" % cachedfile
|
||||
else:
|
||||
if strip:
|
||||
cmd = "strip \"%s\"" % cachedfile
|
||||
shutil.copy2(fnm, cachedfile)
|
||||
os.chmod(cachedfile, 0755)
|
||||
if cmd: os.system(cmd)
|
||||
if cmd: system(cmd)
|
||||
|
||||
# update cache index
|
||||
cache_index[basenm] = digest
|
||||
|
||||
+3
-3
@@ -234,13 +234,13 @@ def test_unicode(config):
|
||||
|
||||
def test_UPX(config):
|
||||
print 'I: testing for UPX...'
|
||||
cmd = "upx -V"
|
||||
cmd = "upx"
|
||||
if opts.upx_dir:
|
||||
cmd = os.path.join(opts.upx_dir, cmd)
|
||||
cmd = '"' + os.path.normpath(os.path.join(opts.upx_dir, cmd)) + '"'
|
||||
|
||||
hasUPX = 0
|
||||
try:
|
||||
vers = os.popen(cmd).readlines()
|
||||
vers = os.popen(cmd + ' -V').readlines()
|
||||
if vers:
|
||||
v = string.split(vers[0])[1]
|
||||
hasUPX = tuple(map(int, string.split(v, ".")))
|
||||
|
||||
Reference in New Issue
Block a user