From 5c7c82baf88f10c126ab5125bb363a562ba61821 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Sun, 26 Feb 2012 12:58:54 +0000 Subject: [PATCH] Make xcode_version work with CLI4.3X Closes Homebrew/homebrew#10460. --- Library/Homebrew/utils.rb | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 6c29ba1056..e469260632 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -363,10 +363,10 @@ module MacOS extend self raise if $1.nil? or not $?.success? $1 rescue - # for people who don't have xcodebuild installed due to using - # some variety of minimal installer, let's try and guess their - # Xcode version - case llvm_build_version.to_i + # For people who's xcode-select is unset, or who have installed + # xcode-gcc-installer or whatever other combinations we can try and + # supprt. See https://github.com/mxcl/homebrew/wiki/Xcode + case nil when 0..2063 then "3.1.0" when 2064..2065 then "3.1.4" when 2366..2325 @@ -381,7 +381,24 @@ module MacOS extend self # https://github.com/mxcl/homebrew/wiki/Xcode "4.0" else - "4.2" + case (clang_version.to_f * 10).to_i + when 0..14 + "3.2.2" + when 15 + "3.2.4" + when 16 + "3.2.5" + when 17..20 + "4.0" + when 21 + "4.1" + when 22..30 + "4.2" + when 31 + "4.3" + else + "4.3" + end end end end