# HG changeset patch # User Anirudha Bose # Date 1379762529 -19800 # Node ID a3a6870253d765d57425cc8c51ebf0e4df23ddcf # Parent 488d0100db6ef2c2098875c1921063922f684b32 [Darwin] darwin_files/standalone.py: Enable running of script on the same application bundle more than once diff --git a/darwin_files/standalone.py b/darwin_files/standalone.py --- a/darwin_files/standalone.py +++ b/darwin_files/standalone.py @@ -21,8 +21,7 @@ ## Resources folder. ## * Shared libraries like libcholmod.so, libumfpack.so, and others which end with .so ## extension are not assigned any path in the Mach-O headers during compilation. This is -## likely to happen while using MXE. This script can fix such errors too, but make sure -## you do not use this script on the same App Bundle more than once. +## likely to happen while using MXE. This script can fix such errors too. from __future__ import print_function from macholib.MachO import MachO @@ -46,7 +45,7 @@ command = 'install_name_tool -change "%s" "@executable_path/../%s" ./%s\n'%(other,relative_name,path) print(command) os.system(command) - elif other.endswith(".so"): + elif other.endswith(".so") and not other.startswith("@executable_path"): command = 'install_name_tool -change "%s" "@executable_path/../lib/%s" ./%s\n'%(other,other,path) print(command) os.system(command)