Skip to content

Commit

Permalink
exceptions: reorder output based on importance.
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMcQuaid committed Nov 5, 2016
1 parent c7de142 commit a1e798d
Showing 1 changed file with 35 additions and 16 deletions.
51 changes: 35 additions & 16 deletions Library/Homebrew/exceptions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -327,22 +327,9 @@ def fetch_issues
end

def dump
if !ARGV.verbose?
puts
puts Formatter.error(Formatter.url(OS::ISSUES_URL), label: "READ THIS")
if formula.tap
case formula.tap.name
when "homebrew/boneyard"
puts "#{formula} was moved to homebrew-boneyard because it has unfixable issues."
puts "Please do not file any issues about this. Sorry!"
else
if issues_url = formula.tap.issues_url
puts "If reporting this issue please do so at (not Homebrew/brew):"
puts " #{Formatter.url(issues_url)}"
end
end
end
else
puts

if ARGV.verbose?
require "system_config"
require "build_environment"

Expand All @@ -360,7 +347,37 @@ def dump
puts logs.map { |fn| " #{fn}" }.join("\n")
end
end

if formula.tap && formula.tap.name == "homebrew/boneyard"
onoe <<-EOS.undent
#{formula} was moved to homebrew-boneyard because it has unfixable issues.
Please do not file any issues about this. Sorry!
EOS
return
end

if formula.tap
if formula.tap.official?
puts Formatter.error(Formatter.url(OS::ISSUES_URL), label: "READ THIS")
elsif issues_url = formula.tap.issues_url
puts <<-EOS.undent
If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
#{Formatter.url(issues_url)}
EOS
else
puts <<-EOS.undent
If reporting this issue please do so to (not Homebrew/brew or Homebrew/core):
#{formula.tap}
EOS
end
else
puts <<-EOS.undent
Do not report this issue to Homebrew/brew or Homebrew/core!
EOS
end

puts

if issues && !issues.empty?
puts "These open issues may also help:"
puts issues.map { |i| "#{i["title"]} #{i["html_url"]}" }.join("\n")
Expand All @@ -369,7 +386,9 @@ def dump
require "diagnostic"
checks = Homebrew::Diagnostic::Checks.new
checks.build_error_checks.each do |check|
out = checks.send(check)
next if out.nil?
puts
ofail out
end
end
Expand Down

0 comments on commit a1e798d

Please sign in to comment.