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
|
# so load any deps before this point! And exit asap afterwards
|
||||||
yield self
|
yield self
|
||||||
rescue Interrupt, RuntimeError, SystemCallError => e
|
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
|
onoe e.inspect
|
||||||
puts e.backtrace
|
puts e.backtrace
|
||||||
|
|
||||||
ohai "Rescuing build..."
|
ohai "Rescuing build..."
|
||||||
if (e.was_running_configure? rescue false) and File.exist? 'config.log'
|
if (e.was_running_configure? rescue false) and File.exist? 'config.log'
|
||||||
puts "It looks like an autotools configure failed."
|
puts "It looks like an autotools configure failed."
|
||||||
|
|||||||
@ -57,7 +57,7 @@ module Homebrew extend self
|
|||||||
end
|
end
|
||||||
|
|
||||||
FORMULA_META_FILES = %w[README README.md ChangeLog COPYING LICENSE LICENCE COPYRIGHT AUTHORS]
|
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']
|
unless ARGV.include? "--no-compat" or ENV['HOMEBREW_NO_COMPAT']
|
||||||
$:.unshift(File.expand_path("#{__FILE__}/../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
|
Homebrew.dump_build_env e.env
|
||||||
puts
|
puts
|
||||||
onoe e
|
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
|
issues = GitHub.issues_for_formula formula_name
|
||||||
puts "These existing issues may help you:", *issues unless issues.empty?
|
if issues.empty?
|
||||||
if e.was_running_configure?
|
puts "If `brew doctor' does not help diagnose the issue, please report the bug:"
|
||||||
puts "It looks like an autotools configure failed."
|
puts " #{Tty.em}#{ISSUES_URL}#{Tty.reset}"
|
||||||
puts "Consider re-running the install with '-vd' to keep 'config.log' around:"
|
else
|
||||||
puts " brew install -vd #{formula_name}"
|
puts "These existing issues may help you:", *issues.map{ |s| " #{Tty.em}#{s}#{Tty.reset}" }
|
||||||
puts "Gist 'config.log' and any error output when reporting an issue."
|
puts "Otherwise, please report the bug:"
|
||||||
puts "Remember to include your config information: brew --config"
|
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
|
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
|
exit 1
|
||||||
rescue RuntimeError, SystemCallError => e
|
rescue RuntimeError, SystemCallError => e
|
||||||
onoe e
|
onoe e
|
||||||
@ -142,7 +138,8 @@ rescue RuntimeError, SystemCallError => e
|
|||||||
exit 1
|
exit 1
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
onoe e
|
onoe e
|
||||||
puts PLEASE_REPORT_BUG
|
puts "#{Tty.white}Please report this bug:"
|
||||||
|
puts " #{Tty.em}#{ISSUES_URL}#{Tty.reset}"
|
||||||
puts e.backtrace
|
puts e.backtrace
|
||||||
exit 1
|
exit 1
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user