diff options
| author | William Woodruff | 2017-08-28 17:33:57 -0400 |
|---|---|---|
| committer | William Woodruff | 2017-08-28 19:05:12 -0400 |
| commit | 18115f0639b2777e15cda9496bb729dd8246d49d (patch) | |
| tree | 4d8e8016efbf2ce928241fbe515faaca0cd3157f /Library/Homebrew/extend | |
| parent | 551e5dd94578062e0ab42bc56e0fdd106807839b (diff) | |
| download | brew-18115f0639b2777e15cda9496bb729dd8246d49d.tar.bz2 | |
mach: Avoid reopening the file for relocation
This commit allows the relocation code to perform install name
and dylib ID changes without reopening the file separately.
Diffstat (limited to 'Library/Homebrew/extend')
| -rw-r--r-- | Library/Homebrew/extend/os/mac/keg_relocate.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Library/Homebrew/extend/os/mac/keg_relocate.rb b/Library/Homebrew/extend/os/mac/keg_relocate.rb index 707710be6..7031bea1e 100644 --- a/Library/Homebrew/extend/os/mac/keg_relocate.rb +++ b/Library/Homebrew/extend/os/mac/keg_relocate.rb @@ -2,7 +2,7 @@ class Keg def fix_dynamic_linkage mach_o_files.each do |file| file.ensure_writable do - change_dylib_id(dylib_id_for(file), file) if file.dylib? + file.change_dylib_id(dylib_id_for(file)) if file.dylib? each_install_name_for(file) do |bad_name| # Don't fix absolute paths unless they are rooted in the build directory @@ -11,7 +11,7 @@ class Keg !bad_name.start_with?(HOMEBREW_TEMP.realpath.to_s) new_name = fixed_name(file, bad_name) - change_install_name(bad_name, new_name, file) unless new_name == bad_name + file.change_install_name(bad_name, new_name, file) end end end @@ -24,7 +24,7 @@ class Keg file.ensure_writable do if file.dylib? id = dylib_id_for(file).sub(relocation.old_prefix, relocation.new_prefix) - change_dylib_id(id, file) + file.change_dylib_id(id) end each_install_name_for(file) do |old_name| @@ -34,7 +34,7 @@ class Keg new_name = old_name.sub(relocation.old_prefix, relocation.new_prefix) end - change_install_name(old_name, new_name, file) if new_name + file.change_install_name(old_name, new_name) if new_name end end end |
