Let 'interactive_shell' take a formula and set ENV vars.

Pull duplicate code out of install --debug and install -i up into
'interactive_shell'.
This commit is contained in:
Adam Vandenberg 2010-08-20 10:01:49 -07:00
parent 7080ea0de6
commit c1e293f5a4
3 changed files with 8 additions and 6 deletions

View File

@ -203,8 +203,7 @@ class Formula
puts "If nothing is installed or the shell exits with a non-zero error code," puts "If nothing is installed or the shell exits with a non-zero error code,"
puts "Homebrew will abort. The installation prefix is:" puts "Homebrew will abort. The installation prefix is:"
puts prefix puts prefix
ENV['HOMEBREW_DEBUG_INSTALL'] = name interactive_shell self
interactive_shell
end end
end end
end end

View File

@ -85,9 +85,7 @@ def install f
puts "to copy the diff to the clipboard." puts "to copy the diff to the clipboard."
end end
ENV['HOMEBREW_DEBUG_PREFIX'] = f.prefix interactive_shell f
ENV['HOMEBREW_DEBUG_INSTALL'] = f.name
interactive_shell
nil nil
elsif ARGV.include? '--help' elsif ARGV.include? '--help'
system './configure --help' system './configure --help'

View File

@ -82,7 +82,12 @@ def pretty_duration s
return "%.1f minutes" % (s/60) return "%.1f minutes" % (s/60)
end 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'] } fork {exec ENV['SHELL'] }
Process.wait Process.wait
unless $?.success? unless $?.success?