diff options
| -rw-r--r-- | Library/Homebrew/formula.rb | 10 | ||||
| -rw-r--r-- | Library/Homebrew/global.rb | 2 | ||||
| -rwxr-xr-x | bin/brew | 27 |
3 files changed, 22 insertions, 17 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index fd9bcbb72..42c0e575a 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -251,9 +251,17 @@ class Formula # so load any deps before this point! And exit asap afterwards yield self rescue Interrupt, RuntimeError, SystemCallError => e - raise unless ARGV.debug? + unless ARGV.debug? + if File.exist? 'config.log' + logs = File.expand_path '~/Library/Logs/Homebrew/' + mkdir_p logs + cp 'config.log', logs + end + raise + end onoe e.inspect puts e.backtrace + ohai "Rescuing build..." if (e.was_running_configure? rescue false) and File.exist? 'config.log' puts "It looks like an autotools configure failed." diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb index e7a7a181f..ed9e3b08a 100644 --- a/Library/Homebrew/global.rb +++ b/Library/Homebrew/global.rb @@ -57,7 +57,7 @@ module Homebrew extend self end FORMULA_META_FILES = %w[README README.md ChangeLog COPYING LICENSE LICENCE COPYRIGHT AUTHORS] -PLEASE_REPORT_BUG = "#{Tty.white}Please report this bug: #{Tty.em}https://github.com/mxcl/homebrew/wiki/Checklist-before-filing-a-new-issue#{Tty.reset}" +ISSUES_URL = "https://github.com/mxcl/homebrew/wiki/checklist-before-filing-a-new-issue" unless ARGV.include? "--no-compat" or ENV['HOMEBREW_NO_COMPAT'] $:.unshift(File.expand_path("#{__FILE__}/../compat")) @@ -118,23 +118,19 @@ rescue BuildError => e Homebrew.dump_build_env e.env puts onoe e - puts PLEASE_REPORT_BUG - # this feature can be slow (depends on network conditions and if github is up) - # so ideally we'd show feedback, eg. "checking for existing issues..." and - # then replace that string with the following when the github api returns issues = GitHub.issues_for_formula formula_name - puts "These existing issues may help you:", *issues unless issues.empty? + if issues.empty? + puts "If `brew doctor' does not help diagnose the issue, please report the bug:" + puts " #{Tty.em}#{ISSUES_URL}#{Tty.reset}" + else + puts "These existing issues may help you:", *issues.map{ |s| " #{Tty.em}#{s}#{Tty.reset}" } + puts "Otherwise, please report the bug:" + puts " #{Tty.em}#{ISSUES_URL}#{Tty.reset}" + end if e.was_running_configure? - puts "It looks like an autotools configure failed." - puts "Consider re-running the install with '-vd' to keep 'config.log' around:" - puts " brew install -vd #{formula_name}" - puts "Gist 'config.log' and any error output when reporting an issue." - puts "Remember to include your config information: brew --config" + puts "We saved the configure log, please gist it if you report the issue:" + puts " ~/Library/Logs/Homebrew/config.log" end - puts - puts "Also try:" - puts " `brew doctor` to check your setup for common problems." - puts " `brew missing` to check installed packages for missing deps." exit 1 rescue RuntimeError, SystemCallError => e onoe e @@ -142,7 +138,8 @@ rescue RuntimeError, SystemCallError => e exit 1 rescue Exception => e onoe e - puts PLEASE_REPORT_BUG + puts "#{Tty.white}Please report this bug:" + puts " #{Tty.em}#{ISSUES_URL}#{Tty.reset}" puts e.backtrace exit 1 end |
