aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorJack Nagel2013-01-09 18:30:33 -0600
committerJack Nagel2013-01-09 18:33:35 -0600
commit003a9e7fd7d0edee68b61873fe1e38e95626407a (patch)
tree10970f9231f1c75f81f348155cd0c3521bf24b1f /Library/Homebrew
parent0949d952dc1a0eda002108b35c7fda38df7448fc (diff)
downloadbrew-003a9e7fd7d0edee68b61873fe1e38e95626407a.tar.bz2
Don't store test Proc if we might need to marshall the formula
Procs cannot be marshalled, but formula objects may be as part of the BuildError exception. If the formula object has a reference to a Proc, this will fail. Work around it by not storing the test Procs during installations.
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/formula.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 2a9e4e704..f8a21ab36 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -800,7 +800,11 @@ private
def test &block
return @test unless block_given?
- @test = block
+ # If this formula is the executing script, we are performing an
+ # install. Since it may be marshalled back to the main process as
+ # part of an exception, don't store this Proc because Procs can't
+ # be marshalled.
+ @test = block unless $0 != HOMEBREW_BREW_FILE.to_s
end
end
end