aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2010-06-11 17:18:05 -0700
committerAdam Vandenberg2010-06-15 08:09:58 -0700
commit6a342c70383e2eec7ccd9f57ab3ad9f9da7aac37 (patch)
tree33cdf3b8d7dd47108925648063f455470f39a483 /Library
parentfb524a778f6bff49d46c6e84f7c25a95f8dd00fc (diff)
downloadhomebrew-6a342c70383e2eec7ccd9f57ab3ad9f9da7aac37.tar.bz2
Set HOMEBREW_DEBUG_INSTALL when in a shell during install -d|-i
When an "install -d formula" fails, and the user gets dropped into an interactive shell, set the HOMEBREW_DEBUG_INSTALL env var to the name for the formula that failed. Also set variable if the user requests an interactive install in the first place. Note that this may be different than the formula being installed, since it may have been a dep that failed. Also remove todo in utils; users can now look for HOMEBREW_DEBUG_INSTALL in their prompt command, and adjust their prompts accordingly.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formula.rb1
-rwxr-xr-xLibrary/Homebrew/install.rb1
-rw-r--r--Library/Homebrew/utils.rb8
3 files changed, 3 insertions, 7 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 2d25d248b..d31c1fa7a 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -215,6 +215,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
end
end
diff --git a/Library/Homebrew/install.rb b/Library/Homebrew/install.rb
index 58c8167d3..cc4be370b 100755
--- a/Library/Homebrew/install.rb
+++ b/Library/Homebrew/install.rb
@@ -85,6 +85,7 @@ def install f
puts "to copy the diff to the clipboard."
end
+ ENV['HOMEBREW_DEBUG_INSTALL'] = f.name
interactive_shell
nil
elsif ARGV.include? '--help'
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index 3d65b74b4..8f3aaca1a 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -47,13 +47,7 @@ def pretty_duration s
end
def interactive_shell
- fork do
- # TODO make the PS1 var change pls
- #brown="\[\033[0;33m\]"
- #reset="\[\033[0m\]"
- #ENV['PS1']="Homebrew-#{HOMEBREW_VERSION} #{brown}\W#{reset}\$ "
- exec ENV['SHELL']
- end
+ fork {exec ENV['SHELL'] }
Process.wait
unless $?.success?
puts "Aborting due to non-zero exit status"