Merge pull request #15845 from MikeMcQuaid/update_deleted_installed

update_report: show "Delete and Installed" header.
This commit is contained in:
Mike McQuaid 2023-08-09 10:59:01 +01:00 committed by GitHub
commit 319faed8f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -753,35 +753,39 @@ class ReporterHub
dump_new_formula_report dump_new_formula_report
dump_new_cask_report dump_new_cask_report
end end
dump_renamed_formula_report if report_all
dump_renamed_cask_report if report_all if report_all
dump_renamed_formula_report
dump_renamed_cask_report
end
dump_deleted_formula_report(report_all) dump_deleted_formula_report(report_all)
dump_deleted_cask_report(report_all) dump_deleted_cask_report(report_all)
outdated_formulae = [] outdated_formulae = []
outdated_casks = [] outdated_casks = []
if !auto_update && report_all if report_all
dump_modified_formula_report if auto_update
dump_modified_cask_report if (changed_formulae = select_formula_or_cask(:M).count) && changed_formulae.positive?
elsif !auto_update ohai "Modified Formulae",
outdated_formulae = Formula.installed.select(&:outdated?).map(&:name) "Modified #{Utils.pluralize("formula", changed_formulae, plural: "e", include_count: true)}."
output_dump_formula_or_cask_report "Outdated Formulae", outdated_formulae end
outdated_casks = Cask::Caskroom.casks.select(&:outdated?).map(&:token) if (changed_casks = select_formula_or_cask(:MC).count) && changed_casks.positive?
output_dump_formula_or_cask_report "Outdated Casks", outdated_casks ohai "Modified Casks", "Modified #{Utils.pluralize("cask", changed_casks, include_count: true)}."
elsif report_all end
if (changed_formulae = select_formula_or_cask(:M).count) && changed_formulae.positive? else
ohai "Modified Formulae", dump_modified_formula_report
"Modified #{Utils.pluralize("formula", changed_formulae, plural: "e", include_count: true)}." dump_modified_cask_report
end
if (changed_casks = select_formula_or_cask(:MC).count) && changed_casks.positive?
ohai "Modified Casks", "Modified #{Utils.pluralize("cask", changed_casks, include_count: true)}."
end end
else else
outdated_formulae = Formula.installed.select(&:outdated?).map(&:name) outdated_formulae = Formula.installed.select(&:outdated?).map(&:name)
outdated_casks = Cask::Caskroom.casks.select(&:outdated?).map(&:token) outdated_casks = Cask::Caskroom.casks.select(&:outdated?).map(&:token)
unless auto_update
output_dump_formula_or_cask_report "Outdated Formulae", outdated_formulae
output_dump_formula_or_cask_report "Outdated Casks", outdated_casks
end
end end
return if outdated_formulae.blank? && outdated_casks.blank? return if outdated_formulae.blank? && outdated_casks.blank?
@ -866,7 +870,12 @@ class ReporterHub
end end
end.compact end.compact
output_dump_formula_or_cask_report "Deleted Formulae", formulae title = if report_all
"Deleted Formulae"
else
"Deleted Installed Formulae"
end
output_dump_formula_or_cask_report title, formulae
end end
def dump_deleted_cask_report(report_all) def dump_deleted_cask_report(report_all)
@ -879,7 +888,12 @@ class ReporterHub
end end
end.compact end.compact
output_dump_formula_or_cask_report "Deleted Casks", casks title = if report_all
"Deleted Casks"
else
"Deleted Installed Casks"
end
output_dump_formula_or_cask_report title, casks
end end
def dump_modified_formula_report def dump_modified_formula_report