From 74b18bfe12a19c9a45d58d4f57c2b6f257b42d6e Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Sun, 9 Aug 2015 07:45:07 -0400 Subject: [PATCH] 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 --- Library/Homebrew/cmd/install.rb | 1 - Library/Homebrew/cmd/reinstall.rb | 1 - Library/Homebrew/cmd/upgrade.rb | 1 - Library/Homebrew/formula_installer.rb | 3 ++- 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index b85206b4d7..45d56701ab 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -176,7 +176,6 @@ module Homebrew fi.debug = ARGV.debug? fi.prelude fi.install - fi.caveats fi.finish rescue FormulaInstallationAlreadyAttemptedError # We already attempted to install f as part of the dependency tree of diff --git a/Library/Homebrew/cmd/reinstall.rb b/Library/Homebrew/cmd/reinstall.rb index bf49282ae9..fe5e2e5ec7 100644 --- a/Library/Homebrew/cmd/reinstall.rb +++ b/Library/Homebrew/cmd/reinstall.rb @@ -27,7 +27,6 @@ module Homebrew fi.debug = ARGV.debug? fi.prelude fi.install - fi.caveats fi.finish rescue FormulaInstallationAlreadyAttemptedError # next diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index 8ae231002d..211d081e7b 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -67,7 +67,6 @@ module Homebrew outdated_keg.unlink if outdated_keg fi.install - fi.caveats fi.finish # If the formula was pinned, and we were force-upgrading it, unpin and diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index ba1da07bf3..8b0c1eebc4 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -364,7 +364,6 @@ class FormulaInstaller fi.prelude oh1 "Installing #{formula.full_name} dependency: #{Tty.green}#{dep.name}#{Tty.reset}" fi.install - fi.caveats fi.finish rescue Exception ignore_interrupts do @@ -409,6 +408,8 @@ class FormulaInstaller end end + caveats + ohai "Summary" if verbose? || show_summary_heading? puts summary ensure