aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMisty De Meo2012-06-25 15:13:35 -0500
committerMisty De Meo2012-06-25 15:13:35 -0500
commit2baf6487d1c876a86a97af0b0d10a5aa9e07d172 (patch)
tree054f561f14ca4866f8d3f22fff633f2f24eb768f
parentf165e0cf5fe283f9d4e61900ddd749540e82b231 (diff)
downloadbrew-2baf6487d1c876a86a97af0b0d10a5aa9e07d172.tar.bz2
Hotfix for stack overflow
Under certain circumstances, MacOS.locate and MacOS.dev_tools_path would call each other recursively. This was limited to systems with Xcode minus the CLT. See Homebrew/homebrew#13012.
-rw-r--r--Library/Homebrew/utils.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index e71fc12f8..cb051e52e 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -320,7 +320,7 @@ module MacOS extend self
# xcode-select is not configured properly (i.e. xctools_fucked?).
p = "#{MacOS.xcode_prefix}/Toolchains/XcodeDefault.xctoolchain/usr/bin/#{tool}"
if File.executable? p
- path Pathname.new p
+ path = Pathname.new p
else
path = nil
end
@@ -334,9 +334,6 @@ module MacOS extend self
@dev_tools_path ||= if File.exist? "/usr/bin/cc" and File.exist? "/usr/bin/make"
# probably a safe enough assumption (the unix way)
Pathname.new "/usr/bin"
- elsif not xctools_fucked?
- # The new way of finding stuff via locate:
- Pathname.new(locate 'make').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}/usr/bin"