Always respect build options when invoking post_install

Fixes Homebrew/homebrew#36335.
This commit is contained in:
Jack Nagel 2015-02-06 22:36:53 -05:00
parent 4851b1e7a8
commit cd522b1719
3 changed files with 8 additions and 2 deletions

View File

@ -1,5 +1,5 @@
module Homebrew
def postinstall
ARGV.formulae.each {|f| f.post_install }
ARGV.formulae.each { |f| f.run_post_install }
end
end

View File

@ -347,6 +347,12 @@ class Formula
method(:post_install).owner == self.class
end
# @private
def run_post_install
self.build = Tab.for_formula(self)
post_install
end
# tell the user about any caveats regarding this package, return a string
def caveats; nil end

View File

@ -594,7 +594,7 @@ class FormulaInstaller
end
def post_install
formula.post_install
formula.run_post_install
rescue Exception => e
opoo "The post-install step did not complete successfully"
puts "You can try again using `brew postinstall #{formula.name}`"