diff options
| author | Jack Nagel | 2013-11-28 19:22:57 -0600 |
|---|---|---|
| committer | Jack Nagel | 2013-11-28 19:27:33 -0600 |
| commit | 841bf8f838f9cfcaa9651e7b0f8282aa6fe3aab5 (patch) | |
| tree | 649ad4f93943e0a3f3c7e7ee26c172b3255c9c7b /Library | |
| parent | 753494c063bdd75a0f569e60eb1ba18e4a65b7ac (diff) | |
| download | homebrew-841bf8f838f9cfcaa9651e7b0f8282aa6fe3aab5.tar.bz2 | |
Implement MacOS.dev_tools_prefix a different way
Avoid producing a dev_tools_path of "//usr/bin".
Fixes #24751.
Closes #24754.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/os/mac.rb | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/Library/Homebrew/os/mac.rb b/Library/Homebrew/os/mac.rb index 6d854558d..316c7f68c 100644 --- a/Library/Homebrew/os/mac.rb +++ b/Library/Homebrew/os/mac.rb @@ -51,24 +51,22 @@ module OS end def dev_tools_prefix - @dev_tools_prefix ||= if tools_in_prefix? CLT::MAVERICKS_PKG_PATH - Pathname.new CLT::MAVERICKS_PKG_PATH + dev_tools_path.parent.parent + end + + def dev_tools_path + @dev_tools_path ||= if tools_in_prefix? CLT::MAVERICKS_PKG_PATH + Pathname.new "#{CLT::MAVERICKS_PKG_PATH}/usr/bin" elsif tools_in_prefix? "/" # probably a safe enough assumption (the unix way) - Pathname.new "/" + Pathname.new "/usr/bin" elsif not Xcode.bad_xcode_select_path? and not `/usr/bin/xcrun -find make 2>/dev/null`.empty? # Note that the exit status of system "xcrun foo" isn't always accurate # Wherever "make" is there are the dev tools. - Pathname.new(`/usr/bin/xcrun -find make`.chomp.sub('/usr/bin/make', '')) + Pathname.new(`/usr/bin/xcrun -find make`.chomp).dirname elsif File.exist? "#{Xcode.prefix}/usr/bin/make" # cc stopped existing with Xcode 4.3, there are c89 and c99 options though - Pathname.new Xcode.prefix - end - end - - def dev_tools_path - @dev_tools_path ||= if File.exist? "#{dev_tools_prefix}/usr/bin/make" - Pathname.new "#{dev_tools_prefix}/usr/bin" + Pathname.new "#{Xcode.prefix}/usr/bin" end end |
