diff options
| author | Max Howell | 2012-03-06 18:08:16 +0000 |
|---|---|---|
| committer | Max Howell | 2012-03-16 21:06:16 +0000 |
| commit | 2c84be96d8325abf6e3062197c99f5dc12f79109 (patch) | |
| tree | 5018faf0171d9b77ed10aae1b4400a1049b004f5 /Library/Homebrew/cmd | |
| parent | 6c0950999f0614d5a0b35dd0700d5928e5d95af0 (diff) | |
| download | brew-2c84be96d8325abf6e3062197c99f5dc12f79109.tar.bz2 | |
Concise --config output for build errors
Rationale, lets only pay attention to the output when it matters. Speeding up diagnosis.
Diffstat (limited to 'Library/Homebrew/cmd')
| -rw-r--r-- | Library/Homebrew/cmd/--config.rb | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/--config.rb b/Library/Homebrew/cmd/--config.rb index 1d74bebf5..da146ac89 100644 --- a/Library/Homebrew/cmd/--config.rb +++ b/Library/Homebrew/cmd/--config.rb @@ -76,14 +76,41 @@ module Homebrew extend self Pathname.new(a_path).realpath.to_s end + def hardware + "CPU: #{Hardware.cores_as_words}-core #{Hardware.bits}-bit #{Hardware.intel_family}" + end + + def kernel + `uname -m`.chomp + end + + # we try to keep output minimal + def dump_build_config + puts "HOMEBREW_PREFIX: #{HOMEBREW_PREFIX}" if HOMEBREW_PREFIX.to_s != "/usr/local" + puts "HOMEBREW_CELLAR: #{HOMEBREW_CELLAR}" if HOMEBREW_CELLAR.to_s != "#{HOMEBREW_PREFIX}/Cellar" + puts hardware + puts "MacOS: #{MACOS_FULL_VERSION}-#{kernel}" + puts "Xcode: #{xcode_version}" + puts "/usr/bin/ruby: #{RUBY_VERSION}-#{RUBY_PATCHLEVEL}" if RUBY_VERSION.to_f != 1.8 + + ruby = Pathname.new("/usr/bin/ruby") + puts "/usr/bin/ruby => #{ruby.realpath}" unless ruby.realpath.to_s =~ %r{^/System} + + ponk = macports_or_fink_installed? + puts "MacPorts/Fink: #{ponk?}" if ponk + + x11 = describe_x11 + puts "X11: #{x11}" unless x11 == "/usr/X11" + end + def config_s; <<-EOS.undent HOMEBREW_VERSION: #{HOMEBREW_VERSION} HEAD: #{sha} HOMEBREW_PREFIX: #{HOMEBREW_PREFIX} HOMEBREW_CELLAR: #{HOMEBREW_CELLAR} - Hardware: #{Hardware.cores_as_words}-core #{Hardware.bits}-bit #{Hardware.intel_family} + #{hardware} OS X: #{MACOS_FULL_VERSION} - Kernel Architecture: #{`uname -m`.chomp} + Kernel Architecture: #{kernel} Xcode: #{xcode_version} GCC-4.0: #{gcc_40 ? "build #{gcc_40}" : "N/A"} GCC-4.2: #{gcc_42 ? "build #{gcc_42}" : "N/A"} |
