Make xcode_version work with CLI4.3X

Closes Homebrew/homebrew#10460.
This commit is contained in:
Max Howell 2012-02-26 12:58:54 +00:00
parent 9ca233812c
commit 5c7c82baf8

View File

@ -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