From fab2cffe5de82b6d540fcf3f4f8873f7cd89af34 Mon Sep 17 00:00:00 2001 From: Josh Hagins Date: Sun, 23 Oct 2016 23:48:07 -0400 Subject: keg_relocate: wrap relocation locations in struct --- Library/Homebrew/extend/os/mac/keg_relocate.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Library/Homebrew/extend') 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 -- cgit v1.2.3