From 1e879eaee8815eebd3bc3f5318f62d1e86b4d62a Mon Sep 17 00:00:00 2001 From: Max Howell Date: Fri, 6 Nov 2009 17:06:12 +0000 Subject: [PATCH] Propagate exit status in ExecutioError exception --- Library/Homebrew/formula.rb | 2 +- Library/Homebrew/global.rb | 5 ++++- Library/Homebrew/utils.rb | 8 ++------ bin/brew | 9 ++++++--- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 6dca1faa2f..0cf351ba2a 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -235,7 +235,7 @@ protected end end rescue - raise BuildError.new(cmd, args) + raise BuildError.new(cmd, args, $?) end private diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb index 946ce66697..8b9aba4b25 100644 --- a/Library/Homebrew/global.rb +++ b/Library/Homebrew/global.rb @@ -57,8 +57,11 @@ HOMEBREW_USER_AGENT = "Homebrew #{HOMEBREW_VERSION} (Ruby #{RUBY_VERSION}-#{RUBY class ExecutionError e puts e.backtrace else onoe e - puts please_report_bug if e.kind_of? BuildError + if e.kind_of? BuildError + puts please_report_bug + puts "Exit Status: #{e.status}" + end end exit 1 rescue Exception => e