aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorJack Nagel2014-04-13 13:53:46 -0500
committerJack Nagel2014-04-13 14:57:11 -0500
commit169aa1ac391ce67894e22d24fa4dae83b5059515 (patch)
treeaecec7cc2f0d8725b64abc34211fd432e77f4cc7 /Library/Homebrew
parentdfddb2a76118a749c506fbc692f48ef326141079 (diff)
downloadbrew-169aa1ac391ce67894e22d24fa4dae83b5059515.tar.bz2
Use correct basename when updating dylib IDs
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/keg_fix_install_names.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/Library/Homebrew/keg_fix_install_names.rb b/Library/Homebrew/keg_fix_install_names.rb
index 5feae1136..35d3ddc09 100644
--- a/Library/Homebrew/keg_fix_install_names.rb
+++ b/Library/Homebrew/keg_fix_install_names.rb
@@ -130,14 +130,16 @@ class Keg < Pathname
end
def dylib_id_for file, options={}
- # the shortpath ensures that library upgrades don’t break installed tools
- relative_path = file.relative_path_from(self)
- shortpath = HOMEBREW_PREFIX.join(relative_path)
+ # The new dylib ID should have the same basename as the old dylib ID, not
+ # the basename of the file itself.
+ basename = File.basename(file.dylib_id)
+ relative_dirname = file.dirname.relative_path_from(self)
+ shortpath = HOMEBREW_PREFIX.join(relative_dirname, basename)
if shortpath.exist? and not options[:keg_only]
shortpath.to_s
else
- "#{HOMEBREW_PREFIX}/opt/#{fname}/#{relative_path}"
+ "#{HOMEBREW_PREFIX}/opt/#{fname}/#{relative_dirname}/#{basename}"
end
end