aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Library/Homebrew/cmd/postinstall.rb2
-rw-r--r--Library/Homebrew/formula.rb6
-rw-r--r--Library/Homebrew/formula_installer.rb2
3 files changed, 8 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/postinstall.rb b/Library/Homebrew/cmd/postinstall.rb
index 52a2c1d47..8e145d3fd 100644
--- a/Library/Homebrew/cmd/postinstall.rb
+++ b/Library/Homebrew/cmd/postinstall.rb
@@ -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
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index dd90d72ee..867b7689d 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -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
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index 46a1345ce..5ef6660fd 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -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}`"