diff options
| author | Adam Vandenberg | 2010-08-20 10:01:49 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2010-08-20 10:03:44 -0700 |
| commit | c1e293f5a4297fdec5d4335013f0e3820194dd58 (patch) | |
| tree | 4587d07d6f9c4c949aa374c26003aec447ce345c /Library | |
| parent | 7080ea0de6d2be573d5ef0bd8c012cfde81cd526 (diff) | |
| download | brew-c1e293f5a4297fdec5d4335013f0e3820194dd58.tar.bz2 | |
Let 'interactive_shell' take a formula and set ENV vars.
Pull duplicate code out of install --debug and install -i up into
'interactive_shell'.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/formula.rb | 3 | ||||
| -rwxr-xr-x | Library/Homebrew/install.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/utils.rb | 7 |
3 files changed, 8 insertions, 6 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index eed9a5957..c3de92f9a 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -203,8 +203,7 @@ class Formula puts "If nothing is installed or the shell exits with a non-zero error code," puts "Homebrew will abort. The installation prefix is:" puts prefix - ENV['HOMEBREW_DEBUG_INSTALL'] = name - interactive_shell + interactive_shell self end end end diff --git a/Library/Homebrew/install.rb b/Library/Homebrew/install.rb index 466277930..722accb52 100755 --- a/Library/Homebrew/install.rb +++ b/Library/Homebrew/install.rb @@ -85,9 +85,7 @@ def install f puts "to copy the diff to the clipboard." end - ENV['HOMEBREW_DEBUG_PREFIX'] = f.prefix - ENV['HOMEBREW_DEBUG_INSTALL'] = f.name - interactive_shell + interactive_shell f nil elsif ARGV.include? '--help' system './configure --help' diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 52b85bd19..829cb5164 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -82,7 +82,12 @@ def pretty_duration s return "%.1f minutes" % (s/60) end -def interactive_shell +def interactive_shell f=nil + unless f.nil? + ENV['HOMEBREW_DEBUG_PREFIX'] = f.prefix + ENV['HOMEBREW_DEBUG_INSTALL'] = f.name + end + fork {exec ENV['SHELL'] } Process.wait unless $?.success? |
