aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorEric Vantillard2016-03-29 10:53:14 +0200
committerXu Cheng2016-04-03 12:15:47 +0800
commit9f79c05656a44f926898774c6029025002bcd621 (patch)
tree0daff1e67e8d51a742c19cfff3076750c50a9292 /Library
parentbdd26d04468e6bbd3cf5e9841a1f163d33884e67 (diff)
downloadbrew-9f79c05656a44f926898774c6029025002bcd621.tar.bz2
diagnostic: improve check for 'install_name_tool'
`install_name_tool` location depends on the location of the active developer directory managed by `xcode-select`. Closes Homebrew/homebrew#50509. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/diagnostic.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb
index 8cf1d6d9a..7a8de7efa 100644
--- a/Library/Homebrew/diagnostic.rb
+++ b/Library/Homebrew/diagnostic.rb
@@ -454,13 +454,15 @@ module Homebrew
def check_for_bad_install_name_tool
return if MacOS.version < "10.9"
- libs = Pathname.new("/usr/bin/install_name_tool").dynamically_linked_libraries
+ install_name_tool = OS::Mac.install_name_tool
+ libs = Pathname.new(install_name_tool).dynamically_linked_libraries
# otool may not work, for example if the Xcode license hasn't been accepted yet
return if libs.empty?
- unless libs.include? "/usr/lib/libxcselect.dylib" then <<-EOS.undent
- You have an outdated version of /usr/bin/install_name_tool installed.
+ expectedLibs = ["/usr/lib/libSystem.B.dylib", "/usr/lib/libxcselect.dylib"]
+ if (libs & expectedLibs).empty? then <<-EOS.undent
+ You have an outdated version of #{install_name_tool} installed.
This will cause binary package installations to fail.
This can happen if you install osx-gcc-installer or RailsInstaller.
To restore it, you must reinstall OS X or restore the binary from