aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend
diff options
context:
space:
mode:
authorJosh Hagins2016-10-23 23:48:07 -0400
committerJosh Hagins2016-10-24 16:21:08 -0400
commitfab2cffe5de82b6d540fcf3f4f8873f7cd89af34 (patch)
tree4228093e30d00c9568538342adf8ef10c55377cd /Library/Homebrew/extend
parentadc4b1f0c73fc549f63e44118b49fdecd32b9394 (diff)
downloadbrew-fab2cffe5de82b6d540fcf3f4f8873f7cd89af34.tar.bz2
keg_relocate: wrap relocation locations in struct
Diffstat (limited to 'Library/Homebrew/extend')
-rw-r--r--Library/Homebrew/extend/os/mac/keg_relocate.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/Library/Homebrew/extend/os/mac/keg_relocate.rb b/Library/Homebrew/extend/os/mac/keg_relocate.rb
index 33ee149ce..8f73daba5 100644
--- a/Library/Homebrew/extend/os/mac/keg_relocate.rb
+++ b/Library/Homebrew/extend/os/mac/keg_relocate.rb
@@ -17,19 +17,19 @@ class Keg
generic_fix_dynamic_linkage
end
- def relocate_dynamic_linkage(old_prefix, new_prefix, old_cellar, new_cellar)
+ def relocate_dynamic_linkage(relocation)
mach_o_files.each do |file|
file.ensure_writable do
if file.dylib?
- id = dylib_id_for(file).sub(old_prefix, new_prefix)
+ id = dylib_id_for(file).sub(relocation.old_prefix, relocation.new_prefix)
change_dylib_id(id, file)
end
each_install_name_for(file) do |old_name|
- if old_name.start_with? old_cellar
- new_name = old_name.sub(old_cellar, new_cellar)
- elsif old_name.start_with? old_prefix
- new_name = old_name.sub(old_prefix, new_prefix)
+ if old_name.start_with? relocation.old_cellar
+ new_name = old_name.sub(relocation.old_cellar, relocation.new_cellar)
+ elsif old_name.start_with? relocation.old_prefix
+ new_name = old_name.sub(relocation.old_prefix, relocation.new_prefix)
end
change_install_name(old_name, new_name, file) if new_name