From 01a6daa4d4d5245b2afcac64109f0037b887b0b3 Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Fri, 24 Feb 2012 12:50:21 -0800 Subject: [PATCH] Add `buildpath` to Formula --- Library/Homebrew/formula.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 30c8d953bd..7335afd246 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -11,6 +11,10 @@ class Formula attr_reader :standard, :unstable attr_reader :bottle_url, :bottle_sha1, :head + # The build folder, usually in /tmp. + # Will only be non-nil during the stage method. + attr_reader :buildpath + # Homebrew determines the name def initialize name='__UNKNOWN__', path=nil set_instance_variable 'homepage' @@ -573,7 +577,10 @@ EOF verify_download_integrity fetched if fetched.kind_of? Pathname mktemp do downloader.stage + # Set path after the downloader changes the working folder. + @buildpath = Pathname.pwd yield + @buildpath = nil end end