Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

formula_installer: improve quiet output. #19135

Merged
merged 1 commit into from
Jan 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions Library/Homebrew/formula_installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,8 @@

# Warn if a more recent version of this formula is available in the tap.
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}."
end
rescue FormulaUnavailableError
Expand Down Expand Up @@ -847,6 +848,7 @@
audit_installed if Homebrew::EnvConfig.developer?

return if !installed_on_request? || installed_as_dependency?
return if quiet?

caveats = Caveats.new(formula)

Expand All @@ -873,13 +875,15 @@
Homebrew::Install.global_post_install

if build_bottle? || skip_post_install?
if build_bottle?
ohai "Not running 'post_install' as we're building a bottle"
elsif skip_post_install?
ohai "Skipping 'post_install' on request"
unless quiet?
if build_bottle?
ohai "Not running 'post_install' as we're building a bottle"
elsif skip_post_install?
ohai "Skipping 'post_install' on request"
end
puts "You can run it manually using:"
puts " brew postinstall #{formula.full_name}"

Check warning on line 885 in Library/Homebrew/formula_installer.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/formula_installer.rb#L884-L885

Added lines #L884 - L885 were not covered by tests
end
puts "You can run it manually using:"
puts " brew postinstall #{formula.full_name}"
else
formula.install_etc_var
post_install if formula.post_install_defined?
Expand Down Expand Up @@ -1321,6 +1325,7 @@
fetch_dependencies

return if only_deps?
return if formula.local_bottle_path.present?

oh1 "Fetching #{Formatter.identifier(formula.full_name)}".strip

Expand All @@ -1347,8 +1352,7 @@
if check_attestation &&
Homebrew::Attestation.enabled? &&
formula.tap&.core_tap? &&
formula.name != "gh" &&
formula.local_bottle_path.blank?
formula.name != "gh"
ohai "Verifying attestation for #{formula.name}"
begin
Homebrew::Attestation.check_core_attestation T.cast(downloadable_object, Bottle)
Expand Down
Loading