Merge pull request #7592 from MikeMcQuaid/display_options_builderror

formula_installer: pass display_options to BuildError.
This commit is contained in:
Mike McQuaid 2020-05-18 13:47:53 +01:00 committed by GitHub
commit ca5eac845d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 11 deletions

View File

@ -279,7 +279,7 @@ class FormulaInstaller
opoo "#{formula.full_name}: #{old_flag} was deprecated; using #{new_flag} instead!"
end
options = display_options(formula)
options = display_options(formula).join(" ")
oh1 "Installing #{Formatter.identifier(formula.full_name)} #{options}".strip if show_header?
unless formula.tap&.private?
@ -529,16 +529,15 @@ class FormulaInstaller
end
def display_options(formula)
options = []
if formula.head?
options << "--HEAD"
options = if formula.head?
["--HEAD"]
elsif formula.devel?
options << "--devel"
["--devel"]
else
[]
end
options += effective_build_options_for(formula).used_options.to_a
return if options.empty?
options.join(" ")
options
end
def inherited_options_for(dep)
@ -793,7 +792,7 @@ class FormulaInstaller
rescue Exception => e # rubocop:disable Lint/RescueException
if e.is_a? BuildError
e.formula = formula
e.options = options
e.options = display_options(formula)
end
ignore_interrupts do

View File

@ -67,8 +67,8 @@ module Utils
return if exception.formula.tap.private?
action = exception.formula.full_name
if (options = exception.options.to_a.presence)
action = "#{action} #{options.map(&:to_s).join(" ")}".strip
if (options = exception.options.to_a.map(&:to_s).join(" ").presence)
action = "#{action} #{options}".strip
end
report_event("BuildError", action)
end