Made depfixer more robust on OSX. Closes #3493.
This commit is contained in:
parent
24f1b96dde
commit
d3ff7d44ab
|
@ -347,7 +347,9 @@ def fix_elf(fname, new_rpath, verbose=True):
|
||||||
e.fix_rpath(new_rpath)
|
e.fix_rpath(new_rpath)
|
||||||
|
|
||||||
def get_darwin_rpaths_to_remove(fname):
|
def get_darwin_rpaths_to_remove(fname):
|
||||||
out = subprocess.check_output(['otool', '-l', fname], universal_newlines=True)
|
out = subprocess.check_output(['otool', '-l', fname],
|
||||||
|
universal_newlines=True,
|
||||||
|
stderr=subprocess.DEVNULL)
|
||||||
result = []
|
result = []
|
||||||
current_cmd = 'FOOBAR'
|
current_cmd = 'FOOBAR'
|
||||||
for line in out.split('\n'):
|
for line in out.split('\n'):
|
||||||
|
@ -371,9 +373,13 @@ def fix_darwin(fname, new_rpath):
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
for rp in rpaths:
|
for rp in rpaths:
|
||||||
subprocess.check_call(['install_name_tool', '-delete_rpath', rp, fname])
|
subprocess.check_call(['install_name_tool', '-delete_rpath', rp, fname],
|
||||||
if new_rpath != '':
|
stdout=subprocess.DEVNULL,
|
||||||
subprocess.check_call(['install_name_tool', '-add_rpath', new_rpath, fname])
|
stderr=subprocess.DEVNULL)
|
||||||
|
if new_rpath:
|
||||||
|
subprocess.check_call(['install_name_tool', '-add_rpath', new_rpath, fname],
|
||||||
|
stdout=subprocess.DEVNULL,
|
||||||
|
stderr=subprocess.DEVNULL)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise
|
raise
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
Loading…
Reference in New Issue