aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/os/mac/keg.rb
diff options
context:
space:
mode:
authorilovezfs2017-09-27 02:08:23 -0700
committerGitHub2017-09-27 02:08:23 -0700
commite8da9613fbe21a409e85af56319ce13c33daffcf (patch)
treea0015c85faa1e9e27ceabdb955b4bb2a3b03ebb9 /Library/Homebrew/os/mac/keg.rb
parent0ba9d9ccd7d99ab8209c396636000d94ba3f5684 (diff)
downloadbrew-e8da9613fbe21a409e85af56319ce13c33daffcf.tar.bz2
Revert "mach: Avoid reopening the file for relocation"
Diffstat (limited to 'Library/Homebrew/os/mac/keg.rb')
-rw-r--r--Library/Homebrew/os/mac/keg.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/Library/Homebrew/os/mac/keg.rb b/Library/Homebrew/os/mac/keg.rb
new file mode 100644
index 000000000..6caadb1d7
--- /dev/null
+++ b/Library/Homebrew/os/mac/keg.rb
@@ -0,0 +1,29 @@
+class Keg
+ def change_dylib_id(id, file)
+ return if file.dylib_id == id
+ @require_relocation = true
+ puts "Changing dylib ID of #{file}\n from #{file.dylib_id}\n to #{id}" if ARGV.debug?
+ MachO::Tools.change_dylib_id(file, id, strict: false)
+ rescue MachO::MachOError
+ onoe <<-EOS.undent
+ Failed changing dylib ID of #{file}
+ from #{file.dylib_id}
+ to #{id}
+ EOS
+ raise
+ end
+
+ def change_install_name(old, new, file)
+ return if old == new
+ @require_relocation = true
+ puts "Changing install name in #{file}\n from #{old}\n to #{new}" if ARGV.debug?
+ MachO::Tools.change_install_name(file, old, new, strict: false)
+ rescue MachO::MachOError
+ onoe <<-EOS.undent
+ Failed changing install name in #{file}
+ from #{old}
+ to #{new}
+ EOS
+ raise
+ end
+end