diff options
| author | Adam Vandenberg | 2009-09-08 11:14:03 -0700 |
|---|---|---|
| committer | Max Howell | 2009-09-10 18:17:15 +0100 |
| commit | 9f79ad9db20634c3a2fb33f50e7739878ecf06c6 (patch) | |
| tree | 73a979687baf502395c56204b99ddd7fb108ee14 /Library | |
| parent | 74675ef347f6997697ac5f957ebff7d363922fc5 (diff) | |
| download | homebrew-9f79ad9db20634c3a2fb33f50e7739878ecf06c6.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.rb | 1 | ||||
| -rw-r--r-- | Library/Homebrew/utils.rb | 5 |
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 |
