aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMax Howell2009-08-10 18:17:11 +0100
committerMax Howell2009-08-10 18:17:11 +0100
commita9e277a3412c738f1c67fa7019ae67708487f3d4 (patch)
tree7f18dbe273d1bc62856514c0d5c61246b37adc77 /Library
parent371786ec963d034255469fbda70e8eba40f2714c (diff)
downloadhomebrew-a9e277a3412c738f1c67fa7019ae67708487f3d4.tar.bz2
CTRL-C for a child process should interrupt brew too
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formula.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index a7bcaf144..dfa70438c 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -151,8 +151,11 @@ private
# Kernel.system but with exceptions
def safe_system cmd, *args
puts "#{cmd} #{args*' '}" if ARGV.verbose?
- # stderr is shown, so hopefully that will explain the problem
- raise ExecutionError.new(cmd, args) unless Kernel.system cmd, *args and $? == 0
+
+ execd=Kernel.system cmd, *args
+ # somehow Ruby doesn't handle the CTRL-C from another process -- WTF!?
+ raise Interrupt, cmd if $?.termsig == 2
+ raise ExecutionError.new(cmd, args) unless execd and $? == 0
end
def curl url, *args