doctor: Add check for install_name_tool

Closes Homebrew/homebrew#29593.
This commit is contained in:
Misty De Meo 2014-06-03 22:49:51 -07:00
parent 3df975897c
commit 8cb980f7be
2 changed files with 15 additions and 0 deletions

View File

@ -312,6 +312,20 @@ def check_for_stray_developer_directory
end
end
def check_for_bad_install_name_tool
return if MacOS.version < 10.9
libs = `otool -L /usr/bin/install_name_tool`
unless libs.include? "/usr/lib/libxcselect.dylib" then <<-EOS.undent
You have an outdated version of /usr/bin/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
the OS packages.
EOS
end
end
def __check_subdir_access base
target = HOMEBREW_PREFIX+base
return unless target.exist?

View File

@ -55,6 +55,7 @@ module Homebrew extend self
check_for_installed_developer_tools
check_xcode_license_approved
check_for_osx_gcc_installer
check_for_bad_install_name_tool
].each do |check|
out = checks.send(check)
opoo out unless out.nil?