Tools: Collapse install_name_tool calls in deploy-mac

This commit is contained in:
Jeffrey Pfau 2015-06-06 12:51:47 -07:00
parent 14dbe7e6db
commit a96759d9e9
1 changed files with 5 additions and 2 deletions

View File

@ -108,16 +108,19 @@ def updateMachO(bin, execPath, root):
qtPath = findQtPath(oldPath) qtPath = findQtPath(oldPath)
if verbose: if verbose:
print('Found Qt path at {}.'.format(qtPath)) print('Found Qt path at {}.'.format(qtPath))
args = [installNameTool]
for path, oldExecPath, newExecPath in toUpdate: for path, oldExecPath, newExecPath in toUpdate:
if path != bin: if path != bin:
updateMachO(path, execPath, root) updateMachO(path, execPath, root)
if verbose: if verbose:
print('Updating Mach-O load from {} to {}...'.format(oldExecPath, newExecPath)) print('Updating Mach-O load from {} to {}...'.format(oldExecPath, newExecPath))
subprocess.check_call([installNameTool, '-change', oldExecPath, newExecPath, bin]) args.extend(['-change', oldExecPath, newExecPath])
else: else:
if verbose: if verbose:
print('Updating Mach-O id from {} to {}...'.format(oldExecPath, newExecPath)) print('Updating Mach-O id from {} to {}...'.format(oldExecPath, newExecPath))
subprocess.check_call([installNameTool, '-id', newExecPath, bin]) args.extend(['-id', newExecPath])
args.append(bin)
subprocess.check_call(args)
if __name__ == '__main__': if __name__ == '__main__':
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()