A bit of cleanup, and call subprocess.Popen with shell=True.
This commit is contained in:
@@ -628,7 +628,7 @@ class WindowsSetup(PlatformSetup):
|
|||||||
|
|
||||||
def run(self, command, name=None):
|
def run(self, command, name=None):
|
||||||
'''Run a program. If the program fails, raise an exception.'''
|
'''Run a program. If the program fails, raise an exception.'''
|
||||||
ret = os.system(command.encode('utf-8'))
|
ret = os.system(command)
|
||||||
if ret:
|
if ret:
|
||||||
if name is None:
|
if name is None:
|
||||||
name = command.split(None, 1)[0]
|
name = command.split(None, 1)[0]
|
||||||
|
|||||||
@@ -394,14 +394,14 @@ class LLManifest(object):
|
|||||||
debugging/informational purpoases, prints out the command's
|
debugging/informational purpoases, prints out the command's
|
||||||
output as it is received."""
|
output as it is received."""
|
||||||
print "Running command:", command
|
print "Running command:", command
|
||||||
fd = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
fd = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
||||||
lines = []
|
lines = []
|
||||||
while True:
|
while True:
|
||||||
lines.append(fd.stdout.readline().rstrip('\n'))
|
lines.append(fd.stdout.readline())
|
||||||
if lines[-1] == '':
|
if lines[-1] == '':
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
print lines[-1],
|
print lines[-1].rstrip('\n'),
|
||||||
output = ''.join(lines)
|
output = ''.join(lines)
|
||||||
if fd.returncode:
|
if fd.returncode:
|
||||||
raise RuntimeError(
|
raise RuntimeError(
|
||||||
|
|||||||
@@ -358,11 +358,11 @@ class WindowsManifest(ViewerManifest):
|
|||||||
if installed_dir != out_path:
|
if installed_dir != out_path:
|
||||||
if install:
|
if install:
|
||||||
out_path = installed_dir
|
out_path = installed_dir
|
||||||
result += 'SetOutPath ' + out_path + '\n'
|
result += 'SetOutPath "' + out_path + '"\n'
|
||||||
if install:
|
if install:
|
||||||
result += 'File "' + pkg_file + '"\n'
|
result += 'File "' + pkg_file + '"\n'
|
||||||
else:
|
else:
|
||||||
result += 'Delete ' + wpath(os.path.join('$INSTDIR', rel_file)) + '\n'
|
result += 'Delete "' + wpath(os.path.join('$INSTDIR', rel_file)) + '"\n'
|
||||||
|
|
||||||
# at the end of a delete, just rmdir all the directories
|
# at the end of a delete, just rmdir all the directories
|
||||||
if not install:
|
if not install:
|
||||||
|
|||||||
Reference in New Issue
Block a user