aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike McQuaid2017-11-05 20:22:01 +0000
committerMike McQuaid2017-11-05 20:22:01 +0000
commite300713f253029ef91a86bc4006d316582fc6d13 (patch)
treefd9b3d1d5035c544341910430c24640a02caf2b7
parentffe523a7a8ec5378577f154d48f1caa22dcfac34 (diff)
downloadbrew-e300713f253029ef91a86bc4006d316582fc6d13.tar.bz2
xcode: check Xcode installed before using version.
This avoids infinite recursion described in: https://github.com/Homebrew/brew/pull/3422#issuecomment-342001451
-rw-r--r--Library/Homebrew/os/mac/xcode.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/Library/Homebrew/os/mac/xcode.rb b/Library/Homebrew/os/mac/xcode.rb
index 4382b505c..71e41fb19 100644
--- a/Library/Homebrew/os/mac/xcode.rb
+++ b/Library/Homebrew/os/mac/xcode.rb
@@ -272,7 +272,9 @@ module OS
def detect_version
# CLT isn't a distinct entity pre-4.3, and pkgutil doesn't exist
# at all on Tiger, so just count it as installed if Xcode is installed
- return MacOS::Xcode.version if MacOS::Xcode.version < "3.0"
+ if MacOS::Xcode.installed? && MacOS::Xcode.version < "3.0"
+ return MacOS::Xcode.version
+ end
version = nil
[MAVERICKS_PKG_ID, MAVERICKS_NEW_PKG_ID, STANDALONE_PKG_ID, FROM_XCODE_PKG_ID].each do |id|