Omit post-install warning unless formula defines it

Closes Homebrew/homebrew#34744.
This commit is contained in:
Jack Nagel 2015-01-12 21:57:18 -05:00
parent d298e54e50
commit 909a5af075
2 changed files with 5 additions and 1 deletions

View File

@ -333,6 +333,10 @@ class Formula
# Can be overridden to run commands on both source and bottle installation.
def post_install; end
def post_install_defined?
method(:post_install).owner == self.class
end
# tell the user about any caveats regarding this package, return a string
def caveats; nil end

View File

@ -383,7 +383,7 @@ class FormulaInstaller
link(keg)
fix_install_names(keg) if OS.mac?
if build_bottle?
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.name}`"
else