From 9294e198591ce9f25ebfb2dc2e8dc16df427b578 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Tue, 1 Dec 2009 10:51:46 +0000 Subject: [PATCH] `brew --config` output improved if no GCC --- Library/Homebrew/brew.h.rb | 6 +++++- bin/brew | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/brew.h.rb b/Library/Homebrew/brew.h.rb index 97d8db29f2..3e23988abc 100644 --- a/Library/Homebrew/brew.h.rb +++ b/Library/Homebrew/brew.h.rb @@ -439,7 +439,11 @@ end def gcc_build `/usr/bin/gcc-4.2 -v 2>&1` =~ /build (\d{4,})/ - $1.to_i + if $1 + $1.to_i + else + nil + end end def llvm_build diff --git a/bin/brew b/bin/brew index 530658a98b..9700e54677 100755 --- a/bin/brew +++ b/bin/brew @@ -45,6 +45,7 @@ def dump_config bits = Hardware.bits cores = Hardware.cores_as_words llvm = llvm_build + gcc = gcc_build sha = `git rev-parse --verify HEAD`.chomp kernel_arch = `uname -m`.chomp @@ -60,7 +61,7 @@ Hardware: #{cores}-core #{bits}-bit #{Hardware.intel_family} OS X: #{MACOS_FULL_VERSION} Kernel Architecture: #{kernel_arch} 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" } MacPorts or Fink? #{macports_or_fink_installed?} EOS