aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2009-09-08 11:14:03 -0700
committerMax Howell2009-09-10 18:17:15 +0100
commitc3169b56001db03171992d205b86951ea574f0e5 (patch)
tree3cc206fef1f6e9e58c73ffb64db55a8eef0e7b53 /Library
parent9f07e5d9fd226f9333b9a1241a4576d9e894f1b2 (diff)
downloadbrew-c3169b56001db03171992d205b86951ea574f0e5.tar.bz2
Display exit code when nonzero.
Brew fails if a tool (make, or whatever) doesn't return an exit code of 0. This patch displays the non-zero code on failure, so we can better diagnose what caused the build to fail (or if we need to add that exit code as exception 'success code'.)
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formula.rb1
-rw-r--r--Library/Homebrew/utils.rb5
2 files changed, 5 insertions, 1 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 23e71e058..7faabbae6 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -184,6 +184,7 @@ protected
end
end
unless $? == 0
+ puts "Exit code: #{$?}"
puts out
raise
end
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index 2a8dff002..7beaba8ad 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -69,7 +69,10 @@ def safe_system cmd, *args
# CTRL-C interrupt to us too, so execution continues, but the exit code os
# still 2 so we raise our own interrupt
raise Interrupt, cmd if $?.termsig == 2
- raise ExecutionError.new(cmd, args) unless exec_success and $?.success?
+ unless exec_success and $?.success?
+ puts "Exit code: #{$?}"
+ raise ExecutionError.new(cmd, args)
+ end
end
def curl url, *args