Merge pull request #19135 from Homebrew/improve_quiet_output

formula_installer: improve quiet output.
This commit is contained in:
Mike McQuaid 2025-01-23 14:40:02 +00:00 committed by GitHub
commit a3b0f9e536
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -440,7 +440,8 @@ class FormulaInstaller
# Warn if a more recent version of this formula is available in the tap. # Warn if a more recent version of this formula is available in the tap.
begin begin
if formula.pkg_version < (v = Formulary.factory(formula.full_name, force_bottle: force_bottle?).pkg_version) if !quiet? &&
formula.pkg_version < (v = Formulary.factory(formula.full_name, force_bottle: force_bottle?).pkg_version)
opoo "#{formula.full_name} #{v} is available and more recent than version #{formula.pkg_version}." opoo "#{formula.full_name} #{v} is available and more recent than version #{formula.pkg_version}."
end end
rescue FormulaUnavailableError rescue FormulaUnavailableError
@ -847,6 +848,7 @@ on_request: installed_on_request?, options:)
audit_installed if Homebrew::EnvConfig.developer? audit_installed if Homebrew::EnvConfig.developer?
return if !installed_on_request? || installed_as_dependency? return if !installed_on_request? || installed_as_dependency?
return if quiet?
caveats = Caveats.new(formula) caveats = Caveats.new(formula)
@ -873,13 +875,15 @@ on_request: installed_on_request?, options:)
Homebrew::Install.global_post_install Homebrew::Install.global_post_install
if build_bottle? || skip_post_install? if build_bottle? || skip_post_install?
if build_bottle? unless quiet?
ohai "Not running 'post_install' as we're building a bottle" if build_bottle?
elsif skip_post_install? ohai "Not running 'post_install' as we're building a bottle"
ohai "Skipping 'post_install' on request" elsif skip_post_install?
ohai "Skipping 'post_install' on request"
end
puts "You can run it manually using:"
puts " brew postinstall #{formula.full_name}"
end end
puts "You can run it manually using:"
puts " brew postinstall #{formula.full_name}"
else else
formula.install_etc_var formula.install_etc_var
post_install if formula.post_install_defined? post_install if formula.post_install_defined?
@ -1321,6 +1325,7 @@ on_request: installed_on_request?, options:)
fetch_dependencies fetch_dependencies
return if only_deps? return if only_deps?
return if formula.local_bottle_path.present?
oh1 "Fetching #{Formatter.identifier(formula.full_name)}".strip oh1 "Fetching #{Formatter.identifier(formula.full_name)}".strip
@ -1347,8 +1352,7 @@ on_request: installed_on_request?, options:)
if check_attestation && if check_attestation &&
Homebrew::Attestation.enabled? && Homebrew::Attestation.enabled? &&
formula.tap&.core_tap? && formula.tap&.core_tap? &&
formula.name != "gh" && formula.name != "gh"
formula.local_bottle_path.blank?
ohai "Verifying attestation for #{formula.name}" ohai "Verifying attestation for #{formula.name}"
begin begin
Homebrew::Attestation.check_core_attestation T.cast(downloadable_object, Bottle) Homebrew::Attestation.check_core_attestation T.cast(downloadable_object, Bottle)