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.
This commit is contained in:
parent
a8f29fb102
commit
8af39f115c
@ -215,6 +215,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
|
interactive_shell
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -85,6 +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_INSTALL'] = f.name
|
||||||
interactive_shell
|
interactive_shell
|
||||||
nil
|
nil
|
||||||
elsif ARGV.include? '--help'
|
elsif ARGV.include? '--help'
|
||||||
|
|||||||
@ -47,13 +47,7 @@ def pretty_duration s
|
|||||||
end
|
end
|
||||||
|
|
||||||
def interactive_shell
|
def interactive_shell
|
||||||
fork do
|
fork {exec ENV['SHELL'] }
|
||||||
# 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
|
|
||||||
Process.wait
|
Process.wait
|
||||||
unless $?.success?
|
unless $?.success?
|
||||||
puts "Aborting due to non-zero exit status"
|
puts "Aborting due to non-zero exit status"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user