aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorMike McQuaid2013-11-26 18:11:23 +0000
committerBrewTestBot2013-11-27 08:53:02 +0000
commit48e4fbc8d9dab9bfbfc16576973aa2d3b1e2bf0d (patch)
treec5342ebb933b03219b432de7554a2f93777799bd /Library/Homebrew
parent9773b9e8bffb5e4529ad3a48923582b69ce7c29b (diff)
downloadbrew-48e4fbc8d9dab9bfbfc16576973aa2d3b1e2bf0d.tar.bz2
Mac: add dev_tools_prefix method.
Basically dev_tools_path without the `/usr/bin`.
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/os/mac.rb18
1 files changed, 12 insertions, 6 deletions
diff --git a/Library/Homebrew/os/mac.rb b/Library/Homebrew/os/mac.rb
index d5b259807..6d854558d 100644
--- a/Library/Homebrew/os/mac.rb
+++ b/Library/Homebrew/os/mac.rb
@@ -50,19 +50,25 @@ module OS
end
end
- def dev_tools_path
- @dev_tools_path ||= if tools_in_prefix? CLT::MAVERICKS_PKG_PATH
- Pathname.new "#{CLT::MAVERICKS_PKG_PATH}/usr/bin"
+ def dev_tools_prefix
+ @dev_tools_prefix ||= if tools_in_prefix? CLT::MAVERICKS_PKG_PATH
+ Pathname.new CLT::MAVERICKS_PKG_PATH
elsif tools_in_prefix? "/"
# probably a safe enough assumption (the unix way)
- Pathname.new "/usr/bin"
+ Pathname.new "/"
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).dirname
+ Pathname.new(`/usr/bin/xcrun -find make`.chomp.sub('/usr/bin/make', ''))
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}/usr/bin"
+ 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"
end
end