don't re-apply changes

This commit is contained in:
2024-09-08 14:16:45 -05:00
parent 22589f24db
commit 4830c86713

View File

@@ -55,13 +55,18 @@ for binary, dependencies in dependency_map.items():
for key in dependency_map:
if key.endswith(dep_short_name):
if binary == app_binary:
print(f'\t{dep} -> @rpath/{dep_short_name}')
new_path = f'@rpath/{dep_short_name}'
if new_path == dep:
continue
print(f'\t{dep} -> {new_path}')
if not dry_run:
print('\t' + subprocess.check_output(['install_name_tool', '-change', dep, f'@rpath/{dep_short_name}', binary], text=True))
print('\t' + subprocess.check_output(['install_name_tool', '-change', dep, new_path, binary], text=True))
else:
new_path = f'@loader_path/{dep_short_name}'
if is_framework:
new_path = f'@loader_path/../../../{dep_short_name}'
if new_path == dep:
continue
print(f'\t{dep} -> {new_path}')
if not dry_run:
print('\t' + subprocess.check_output(['install_name_tool', '-change', dep, new_path, binary], text=True))