brew --config output improved if no GCC

This commit is contained in:
Max Howell 2009-12-01 10:51:46 +00:00
parent a011dd6762
commit 9294e19859
2 changed files with 7 additions and 2 deletions

View File

@ -439,7 +439,11 @@ end
def gcc_build def gcc_build
`/usr/bin/gcc-4.2 -v 2>&1` =~ /build (\d{4,})/ `/usr/bin/gcc-4.2 -v 2>&1` =~ /build (\d{4,})/
$1.to_i if $1
$1.to_i
else
nil
end
end end
def llvm_build def llvm_build

View File

@ -45,6 +45,7 @@ def dump_config
bits = Hardware.bits bits = Hardware.bits
cores = Hardware.cores_as_words cores = Hardware.cores_as_words
llvm = llvm_build llvm = llvm_build
gcc = gcc_build
sha = `git rev-parse --verify HEAD`.chomp sha = `git rev-parse --verify HEAD`.chomp
kernel_arch = `uname -m`.chomp kernel_arch = `uname -m`.chomp
@ -60,7 +61,7 @@ Hardware: #{cores}-core #{bits}-bit #{Hardware.intel_family}
OS X: #{MACOS_FULL_VERSION} OS X: #{MACOS_FULL_VERSION}
Kernel Architecture: #{kernel_arch} Kernel Architecture: #{kernel_arch}
Ruby: #{RUBY_VERSION}-#{RUBY_PATCHLEVEL} Ruby: #{RUBY_VERSION}-#{RUBY_PATCHLEVEL}
GCC: 4.2 build #{gcc_build} GCC-4.2: #{gcc ? "build #{gcc}" : "N/A"}
LLVM: #{llvm ? "build #{llvm}" : "N/A" } LLVM: #{llvm ? "build #{llvm}" : "N/A" }
MacPorts or Fink? #{macports_or_fink_installed?} MacPorts or Fink? #{macports_or_fink_installed?}
EOS EOS