aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend/os
diff options
context:
space:
mode:
authorilovezfs2017-09-27 02:08:23 -0700
committerGitHub2017-09-27 02:08:23 -0700
commite8da9613fbe21a409e85af56319ce13c33daffcf (patch)
treea0015c85faa1e9e27ceabdb955b4bb2a3b03ebb9 /Library/Homebrew/extend/os
parent0ba9d9ccd7d99ab8209c396636000d94ba3f5684 (diff)
downloadbrew-e8da9613fbe21a409e85af56319ce13c33daffcf.tar.bz2
Revert "mach: Avoid reopening the file for relocation"
Diffstat (limited to 'Library/Homebrew/extend/os')
-rw-r--r--Library/Homebrew/extend/os/mac/keg_relocate.rb15
1 files changed, 4 insertions, 11 deletions
diff --git a/Library/Homebrew/extend/os/mac/keg_relocate.rb b/Library/Homebrew/extend/os/mac/keg_relocate.rb
index 7a1f42f8b..707710be6 100644
--- a/Library/Homebrew/extend/os/mac/keg_relocate.rb
+++ b/Library/Homebrew/extend/os/mac/keg_relocate.rb
@@ -2,10 +2,7 @@ class Keg
def fix_dynamic_linkage
mach_o_files.each do |file|
file.ensure_writable do
- if file.dylib?
- @require_relocation = true
- file.change_dylib_id(dylib_id_for(file))
- end
+ change_dylib_id(dylib_id_for(file), 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
@@ -14,9 +11,7 @@ class Keg
!bad_name.start_with?(HOMEBREW_TEMP.realpath.to_s)
new_name = fixed_name(file, bad_name)
-
- @require_relocation = true
- file.change_install_name(bad_name, new_name, file)
+ change_install_name(bad_name, new_name, file) unless new_name == bad_name
end
end
end
@@ -28,9 +23,8 @@ class Keg
mach_o_files.each do |file|
file.ensure_writable do
if file.dylib?
- @require_relocation = true
id = dylib_id_for(file).sub(relocation.old_prefix, relocation.new_prefix)
- file.change_dylib_id(id)
+ change_dylib_id(id, file)
end
each_install_name_for(file) do |old_name|
@@ -40,8 +34,7 @@ class Keg
new_name = old_name.sub(relocation.old_prefix, relocation.new_prefix)
end
- @require_relocation = true
- file.change_install_name(old_name, new_name) if new_name
+ change_install_name(old_name, new_name, file) if new_name
end
end
end