keg_relocate: Check HOMEBREW_TEMP's realpath when excluding name changes.

Since /tmp (the default HOMEBREW_TEMP) is a symlink to /private/tmp,
some build systems (like Parrot's) will attempt to use the realpath
instead of the literal /tmp we supply it with. This breaks the relocation
code, which only tested the literal HOMEBREW_TEMP and not its realpath.
This commit is contained in:
William Woodruff 2017-01-07 15:06:46 -05:00
parent 8712139327
commit 6b63abb850
No known key found for this signature in database
GPG Key ID: 85AE00C504833B3C

View File

@ -6,7 +6,9 @@ class Keg
each_install_name_for(file) do |bad_name|
# Don't fix absolute paths unless they are rooted in the build directory
next if bad_name.start_with?("/") && !bad_name.start_with?(HOMEBREW_TEMP.to_s)
next if bad_name.start_with?("/") &&
!bad_name.start_with?(HOMEBREW_TEMP.to_s) &&
!bad_name.start_with?(HOMEBREW_TEMP.realpath.to_s)
new_name = fixed_name(file, bad_name)
change_install_name(bad_name, new_name, file) unless new_name == bad_name