aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2013-12-04 22:37:57 -0600
committerJack Nagel2013-12-04 22:37:57 -0600
commit3e733aef7c4454e7ae376ff61a9bc62eb4caa915 (patch)
tree08416166011bfce0dae9734cb98ffde144992555 /Library
parent75b77125e92f616d35b5949eac9956ff8e9ccb3c (diff)
downloadhomebrew-3e733aef7c4454e7ae376ff61a9bc62eb4caa915.tar.bz2
relocate_install_names: rewrite cellar names before prefix names
The cellar may overlap with the prefix, so if we replace the prefix first, we will end up with paths like "@@HOMEBREW_PREFIX@@/Cellar" instead of "@@HOMEBREW_CELLAR@@", which will break on installations where the cellar and prefix are disjoint.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/keg_fix_install_names.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/Library/Homebrew/keg_fix_install_names.rb b/Library/Homebrew/keg_fix_install_names.rb
index aa126228a..3c46c1a2f 100644
--- a/Library/Homebrew/keg_fix_install_names.rb
+++ b/Library/Homebrew/keg_fix_install_names.rb
@@ -18,6 +18,15 @@ class Keg
def relocate_install_names old_prefix, new_prefix, old_cellar, new_cellar, options={}
mach_o_files.each do |file|
+ install_names_for(file, options, relocate_reject_proc(old_cellar)) do |id, old_cellar_names|
+ file.ensure_writable do
+ old_cellar_names.each do |old_cellar_name|
+ new_cellar_name = old_cellar_name.to_s.gsub old_cellar, new_cellar
+ change_install_name(old_cellar_name, new_cellar_name, file)
+ end
+ end
+ end
+
install_names_for(file, options, relocate_reject_proc(old_prefix)) do |id, old_prefix_names|
file.ensure_writable do
new_prefix_id = id.to_s.gsub old_prefix, new_prefix
@@ -29,15 +38,6 @@ class Keg
end
end
end
-
- install_names_for(file, options, relocate_reject_proc(old_cellar)) do |id, old_cellar_names|
- file.ensure_writable do
- old_cellar_names.each do |old_cellar_name|
- new_cellar_name = old_cellar_name.to_s.gsub old_cellar, new_cellar
- change_install_name(old_cellar_name, new_cellar_name, file)
- end
- end
- end
end
# Search for pkgconfig .pc files and relocate references to the cellar