diff options
| author | Xu Cheng | 2015-08-07 13:56:12 +0800 |
|---|---|---|
| committer | Xu Cheng | 2015-08-08 17:50:49 +0800 |
| commit | e60dc64828617a6d358687480ce4181fbb1fc12d (patch) | |
| tree | 4b0ee7673befeaaff778798789e3661de991f5b8 /Library/Homebrew | |
| parent | 8fecd4c198948dc1d86240b1a3ee4648da49ffe0 (diff) | |
| download | brew-e60dc64828617a6d358687480ce4181fbb1fc12d.tar.bz2 | |
only run post_install if it's defined
Closes Homebrew/homebrew#42593.
Signed-off-by: Xu Cheng <xucheng@me.com>
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/cmd/postinstall.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/formula_installer.rb | 12 |
2 files changed, 8 insertions, 6 deletions
diff --git a/Library/Homebrew/cmd/postinstall.rb b/Library/Homebrew/cmd/postinstall.rb index 6630afba1..f20b7ad54 100644 --- a/Library/Homebrew/cmd/postinstall.rb +++ b/Library/Homebrew/cmd/postinstall.rb @@ -2,7 +2,7 @@ require "sandbox" module Homebrew def postinstall - ARGV.resolved_formulae.each { |f| run_post_install(f) } + ARGV.resolved_formulae.select(&:post_install_defined?).each { |f| run_post_install(f) } end def run_post_install(formula) diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 9ea9b31ae..ba1da07bf 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -400,11 +400,13 @@ class FormulaInstaller link(keg) fix_install_names(keg) - if build_bottle? && formula.post_install_defined? - ohai "Not running post_install as we're building a bottle" - puts "You can run it manually using `brew postinstall #{formula.full_name}`" - else - post_install + if formula.post_install_defined? + if build_bottle? + ohai "Not running post_install as we're building a bottle" + puts "You can run it manually using `brew postinstall #{formula.full_name}`" + else + post_install + end end ohai "Summary" if verbose? || show_summary_heading? |
