put caveats in finish after post_install Homebrew/homebrew#42565

When running brew -v install, long post_install output from the formula,
presumably from upstream, may hide the important instructions in the
caveats and confuse the user. For example, postgresql runs initdb which
prints its own instructions for running the database, making the caveats
scroll off screen.

Per xu-cheng's instructions in Homebrew/homebrew#42565 :

Remove the explicit call to caveats from the install, reinstall, and
upgrade commands, as well as the dependency installer code in
FormulaInstaller#install_dependency , and call caveats right before the
summary code in FormulaInstaller#finish .

Closes Homebrew/homebrew#42565.

Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
Rafael Kitover 2015-08-09 07:45:07 -04:00 committed by Xu Cheng
parent 3518cda792
commit 74b18bfe12
4 changed files with 2 additions and 4 deletions

View File

@ -176,7 +176,6 @@ module Homebrew
fi.debug = ARGV.debug? fi.debug = ARGV.debug?
fi.prelude fi.prelude
fi.install fi.install
fi.caveats
fi.finish fi.finish
rescue FormulaInstallationAlreadyAttemptedError rescue FormulaInstallationAlreadyAttemptedError
# We already attempted to install f as part of the dependency tree of # We already attempted to install f as part of the dependency tree of

View File

@ -27,7 +27,6 @@ module Homebrew
fi.debug = ARGV.debug? fi.debug = ARGV.debug?
fi.prelude fi.prelude
fi.install fi.install
fi.caveats
fi.finish fi.finish
rescue FormulaInstallationAlreadyAttemptedError rescue FormulaInstallationAlreadyAttemptedError
# next # next

View File

@ -67,7 +67,6 @@ module Homebrew
outdated_keg.unlink if outdated_keg outdated_keg.unlink if outdated_keg
fi.install fi.install
fi.caveats
fi.finish fi.finish
# If the formula was pinned, and we were force-upgrading it, unpin and # If the formula was pinned, and we were force-upgrading it, unpin and

View File

@ -364,7 +364,6 @@ class FormulaInstaller
fi.prelude fi.prelude
oh1 "Installing #{formula.full_name} dependency: #{Tty.green}#{dep.name}#{Tty.reset}" oh1 "Installing #{formula.full_name} dependency: #{Tty.green}#{dep.name}#{Tty.reset}"
fi.install fi.install
fi.caveats
fi.finish fi.finish
rescue Exception rescue Exception
ignore_interrupts do ignore_interrupts do
@ -409,6 +408,8 @@ class FormulaInstaller
end end
end end
caveats
ohai "Summary" if verbose? || show_summary_heading? ohai "Summary" if verbose? || show_summary_heading?
puts summary puts summary
ensure ensure