Save config.log to ~/Library/Logs/Homebrew
Also tidied error output. Still could be tidied quite a lot but I am still considering how best to go about it.
This commit is contained in:
parent
dfe1eb31ca
commit
b5c709e2ed
@ -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."
|
||||
|
||||
@ -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"))
|
||||
|
||||
29
bin/brew
29
bin/brew
@ -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 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"
|
||||
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 "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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user