Expand quiet checks in update and update-report

This commit is contained in:
Darren Kavanagh 2021-03-12 19:38:08 -08:00
parent 433cd83cbc
commit b66b461811
No known key found for this signature in database
GPG Key ID: A258D1E837E3C689
2 changed files with 6 additions and 3 deletions

View File

@ -129,7 +129,7 @@ module Homebrew
if hub.empty? if hub.empty?
puts_stdout_or_stderr "No changes to formulae." unless args.quiet? puts_stdout_or_stderr "No changes to formulae." unless args.quiet?
else else
hub.dump(updated_formula_report: !args.preinstall?) hub.dump(updated_formula_report: !args.preinstall?) unless args.quiet?
hub.reporters.each(&:migrate_tap_migration) hub.reporters.each(&:migrate_tap_migration)
hub.reporters.each { |r| r.migrate_formula_rename(force: args.force?, verbose: args.verbose?) } hub.reporters.each { |r| r.migrate_formula_rename(force: args.force?, verbose: args.verbose?) }
CacheStoreDatabase.use(:descriptions) do |db| CacheStoreDatabase.use(:descriptions) do |db|
@ -137,7 +137,7 @@ module Homebrew
.update_from_report!(hub) .update_from_report!(hub)
end end
unless args.preinstall? if !args.preinstall? && !args.quiet?
outdated_formulae = Formula.installed.count(&:outdated?) outdated_formulae = Formula.installed.count(&:outdated?)
outdated_casks = Cask::Caskroom.casks.count(&:outdated?) outdated_casks = Cask::Caskroom.casks.count(&:outdated?)
update_pronoun = if (outdated_formulae + outdated_casks) == 1 update_pronoun = if (outdated_formulae + outdated_casks) == 1

View File

@ -308,6 +308,7 @@ homebrew-update() {
-\?|-h|--help|--usage) brew help update; exit $? ;; -\?|-h|--help|--usage) brew help update; exit $? ;;
--verbose) HOMEBREW_VERBOSE=1 ;; --verbose) HOMEBREW_VERBOSE=1 ;;
--debug) HOMEBREW_DEBUG=1 ;; --debug) HOMEBREW_DEBUG=1 ;;
--quiet) HOMEBREW_QUIET=1 ;;
--merge) HOMEBREW_MERGE=1 ;; --merge) HOMEBREW_MERGE=1 ;;
--force) HOMEBREW_UPDATE_FORCE=1 ;; --force) HOMEBREW_UPDATE_FORCE=1 ;;
--simulate-from-current-branch) HOMEBREW_SIMULATE_FROM_CURRENT_BRANCH=1 ;; --simulate-from-current-branch) HOMEBREW_SIMULATE_FROM_CURRENT_BRANCH=1 ;;
@ -315,6 +316,7 @@ homebrew-update() {
--*) ;; --*) ;;
-*) -*)
[[ "$option" = *v* ]] && HOMEBREW_VERBOSE=1 [[ "$option" = *v* ]] && HOMEBREW_VERBOSE=1
[[ "$option" = *q* ]] && HOMEBREW_QUIET=1
[[ "$option" = *d* ]] && HOMEBREW_DEBUG=1 [[ "$option" = *d* ]] && HOMEBREW_DEBUG=1
[[ "$option" = *f* ]] && HOMEBREW_UPDATE_FORCE=1 [[ "$option" = *f* ]] && HOMEBREW_UPDATE_FORCE=1
;; ;;
@ -661,7 +663,8 @@ EOS
then then
brew update-report "$@" brew update-report "$@"
return $? return $?
elif [[ -z "$HOMEBREW_UPDATE_PREINSTALL" ]] elif [[ -z "$HOMEBREW_UPDATE_PREINSTALL" &&
-z "$HOMEBREW_QUIET" ]]
then then
echo "Already up-to-date." echo "Already up-to-date."
fi fi