update-report: summarize updated casks for --preinstall

Also, show less output if --quiet is passed.
This commit is contained in:
EricFromCanada 2020-12-14 19:49:35 -05:00
parent 26a59c9c92
commit 1acb085574

View File

@ -66,7 +66,7 @@ module Homebrew
HOMEBREW_REPOSITORY.cd do HOMEBREW_REPOSITORY.cd do
donation_message_displayed = donation_message_displayed =
Utils.popen_read("git", "config", "--get", "homebrew.donationmessage").chomp == "true" Utils.popen_read("git", "config", "--get", "homebrew.donationmessage").chomp == "true"
unless donation_message_displayed if !donation_message_displayed && !args.quiet?
ohai "Homebrew is run entirely by unpaid volunteers. Please consider donating:" ohai "Homebrew is run entirely by unpaid volunteers. Please consider donating:"
puts " #{Formatter.url("https://github.com/Homebrew/brew#donations")}\n" puts " #{Formatter.url("https://github.com/Homebrew/brew#donations")}\n"
@ -118,7 +118,7 @@ module Homebrew
if updated if updated
if hub.empty? if hub.empty?
puts "No changes to formulae." puts "No changes to formulae." unless args.quiet?
else else
hub.dump(updated_formula_report: !args.preinstall?) hub.dump(updated_formula_report: !args.preinstall?)
hub.reporters.each(&:migrate_tap_migration) hub.reporters.each(&:migrate_tap_migration)
@ -130,7 +130,7 @@ module Homebrew
end end
puts if args.preinstall? puts if args.preinstall?
elsif !args.preinstall? && !ENV["HOMEBREW_UPDATE_FAILED"] elsif !args.preinstall? && !ENV["HOMEBREW_UPDATE_FAILED"]
puts "Already up-to-date." puts "Already up-to-date." unless args.quiet?
end end
Commands.rebuild_commands_completion_list Commands.rebuild_commands_completion_list
@ -456,7 +456,15 @@ class ReporterHub
dump_formula_report :R, "Renamed Formulae" dump_formula_report :R, "Renamed Formulae"
dump_formula_report :D, "Deleted Formulae" dump_formula_report :D, "Deleted Formulae"
dump_formula_report :AC, "New Casks" dump_formula_report :AC, "New Casks"
if updated_formula_report
dump_formula_report :MC, "Updated Casks" dump_formula_report :MC, "Updated Casks"
else
updated = select_formula(:MC).count
if updated.positive?
ohai "Updated Casks"
puts "Updated #{updated} #{"cask".pluralize(updated)}."
end
end
dump_formula_report :DC, "Deleted Casks" dump_formula_report :DC, "Deleted Casks"
end end