aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorWilliam Woodruff2017-02-21 15:02:54 -0500
committerGitHub2017-02-21 15:02:54 -0500
commitebb2b3aa6be9f286ed1b78b5a9234933ab4b1a12 (patch)
tree7f738c172a005bf7a7cbdfde709d0f0d7116bd5f /Library
parent7619bc15ccdd95682b15ba1a7507beba59ba61e3 (diff)
parent0f89f6520ee9054d3e1ba09a3f6e14455375d2ed (diff)
downloadbrew-ebb2b3aa6be9f286ed1b78b5a9234933ab4b1a12.tar.bz2
Merge pull request #2036 from woodruffw/rust-hack
keg_relocate: Don't relocate dylib IDs containing metavariables.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/extend/os/mac/keg_relocate.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/Library/Homebrew/extend/os/mac/keg_relocate.rb b/Library/Homebrew/extend/os/mac/keg_relocate.rb
index f44a97b31..476e5da4a 100644
--- a/Library/Homebrew/extend/os/mac/keg_relocate.rb
+++ b/Library/Homebrew/extend/os/mac/keg_relocate.rb
@@ -78,13 +78,19 @@ class Keg
end
end
+ def filename_contains_metavariable?(fn)
+ fn =~ /^@(loader_|executable_|r)path/
+ end
+
def each_install_name_for(file, &block)
dylibs = file.dynamically_linked_libraries
- dylibs.reject! { |fn| fn =~ /^@(loader_|executable_|r)path/ }
+ dylibs.reject! { |fn| filename_contains_metavariable?(fn) }
dylibs.each(&block)
end
def dylib_id_for(file)
+ return file.dylib_id if filename_contains_metavariable?(file.dylib_id)
+
# 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)