diff options
Diffstat (limited to 'Library/Homebrew/cmd')
| -rw-r--r-- | Library/Homebrew/cmd/doctor.rb | 37 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/install.rb | 20 |
2 files changed, 9 insertions, 48 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index 4db70cb32..caa9d3191 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -181,41 +181,12 @@ def check_for_broken_symlinks end end -def check_gcc_42 - if MacOS.gcc_42_build_version == nil - # Don't show this warning on Xcode 4.2+ - if MacOS.xcode_version < "4.2" - "We couldn't detect gcc 4.2.x. Some formulae require this compiler." - end - elsif MacOS.gcc_42_build_version < RECOMMENDED_GCC_42 - <<-EOS.undent - Your gcc 4.2.x version is older than the recommended version. - It may be advisable to upgrade to the latest release of Xcode. +def check_for_latest_xcode + if MacOS.xcode_version.nil? then return <<-EOS.undent + We couldn't detect any version of Xcode. + If you downloaded Xcode from the App Store, you may need to run the installer. EOS end -end - -def check_xcode_exists - if MacOS.xcode_version == nil - <<-EOS.undent - We couldn't detect any version of Xcode. - If you downloaded Xcode from the App Store, you may need to run the installer. - EOS - elsif MacOS.xcode_version < "4.0" - if MacOS.gcc_40_build_version == nil - "We couldn't detect gcc 4.0.x. Some formulae require this compiler." - elsif MacOS.gcc_40_build_version < RECOMMENDED_GCC_40 - <<-EOS.undent - Your gcc 4.0.x version is older than the recommended version. - It may be advisable to upgrade to the latest release of Xcode. - EOS - end - end -end - -def check_for_latest_xcode - # the check_xcode_exists check is enough - return if MacOS.xcode_version.nil? latest_xcode = case MacOS.version when 10.5 then "3.1.4" diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index bfc5d3e7b..e4ffe3268 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -34,20 +34,10 @@ module Homebrew extend self raise "Cannot write to #{HOMEBREW_PREFIX}" unless HOMEBREW_PREFIX.writable? or HOMEBREW_PREFIX.to_s == '/usr/local' end - def check_cc - if MacOS.snow_leopard? - if MacOS.llvm_build_version < RECOMMENDED_LLVM - opoo "You should upgrade to Xcode 3.2.6" - end - else - if (MacOS.gcc_40_build_version < RECOMMENDED_GCC_40) or (MacOS.gcc_42_build_version < RECOMMENDED_GCC_42) - opoo "You should upgrade to Xcode 3.1.4" - end - end - rescue - # the reason we don't abort is some formula don't require Xcode - # TODO allow formula to declare themselves as "not needing Xcode" - opoo "Xcode is not installed! Builds may fail!" + def check_xcode + require 'cmd/doctor' + xcode = Checks.new.check_for_latest_xcode + opoo xcode unless xcode.nil? end def check_macports @@ -70,7 +60,7 @@ module Homebrew extend self def perform_preinstall_checks check_ppc check_writable_install_location - check_cc + check_xcode check_macports check_cellar end |
