All: Fix small bugs in deploy-mac.py when using a root

This commit is contained in:
Jeffrey Pfau 2014-12-27 18:32:33 -08:00
parent 27eb75fcde
commit 444d703e90

View File

@ -60,14 +60,13 @@ def parseOtoolLine(line, execPath, root):
newExecPath = ['@executable_path', '..', 'Frameworks']
newPath = execPath[:-1]
newPath.append('Frameworks')
if split[0] == '/':
split[:1] = root
if split[:3] == ['/', 'usr', 'lib'] or split[:2] == ['/', 'System']:
return None, None, None, None
if split[0] == '@executable_path':
split[:1] = execPath
if split[:3] == ['/', 'usr', 'lib'] or split[:2] == ['/', 'System']:
newPath = None
newExecPath = None
else:
if split[0] == '/' and not os.access(joinPath(split), os.F_OK):
print(split)
split[:1] = root
isFramework = False
if not split[-1].endswith('.dylib'):
isFramework = True
@ -133,7 +132,7 @@ if __name__ == '__main__':
if executable.endswith('.dSYM'):
continue
fullPath = os.path.join(args.bundle, 'Contents/MacOS/', executable)
updateMachO(fullPath, splitPath(os.path.join(args.bundle, 'Contents/MacOS')), args.root)
updateMachO(fullPath, splitPath(os.path.join(args.bundle, 'Contents/MacOS')), splitPath(args.root))
if args.qt_plugins:
try:
shutil.rmtree(os.path.join(args.bundle, 'Contents/PlugIns/'))
@ -152,4 +151,4 @@ if __name__ == '__main__':
makedirs(newDir)
newPath = os.path.join(newDir, plug)
shutil.copy2(os.path.join(qtPath, 'plugins', plugin), newPath)
updateMachO(newPath, splitPath(os.path.join(args.bundle, 'Contents/MacOS')), args.root)
updateMachO(newPath, splitPath(os.path.join(args.bundle, 'Contents/MacOS')), splitPath(args.root))