diff options
| author | Max Howell | 2009-11-12 01:33:14 +0000 |
|---|---|---|
| committer | Max Howell | 2009-11-12 01:37:02 +0000 |
| commit | 00e227ac46ff9ff0f329e771e2f0de2932cfa6bc (patch) | |
| tree | a50bc58227e23cd8cf8b3c57cb02312b7f2a69b4 | |
| parent | 6488212a54f099175b6f7e408e71524522005d9c (diff) | |
| download | brew-00e227ac46ff9ff0f329e771e2f0de2932cfa6bc.tar.bz2 | |
More tweaking of main exception handler output
| -rw-r--r-- | Library/Homebrew/brew.h.rb | 1 | ||||
| -rwxr-xr-x | Library/Homebrew/test/unittest.rb | 20 | ||||
| -rwxr-xr-x | bin/brew | 24 |
3 files changed, 27 insertions, 18 deletions
diff --git a/Library/Homebrew/brew.h.rb b/Library/Homebrew/brew.h.rb index 8b73ccbcc..d8ab4305e 100644 --- a/Library/Homebrew/brew.h.rb +++ b/Library/Homebrew/brew.h.rb @@ -22,6 +22,7 @@ # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # FORMULA_META_FILES = %w[README ChangeLog COPYING LICENSE COPYRIGHT AUTHORS] +PLEASE_REPORT_BUG = "#{Tty.white}Please report this bug to #{Tty.em}#{HOMEBREW_WWW}#{Tty.reset}" def __make url, name require 'formula' diff --git a/Library/Homebrew/test/unittest.rb b/Library/Homebrew/test/unittest.rb index d611ce234..f2c5d73b2 100755 --- a/Library/Homebrew/test/unittest.rb +++ b/Library/Homebrew/test/unittest.rb @@ -7,15 +7,6 @@ ABS__FILE__=File.expand_path(__FILE__) $:.push(File.expand_path(__FILE__+'/../..')) require 'extend/pathname' -require 'utils' -require 'hardware' -require 'formula' -require 'download_strategy' -require 'keg' -require 'utils' -require 'brew.h' -require 'hardware' -require 'update' # these are defined in global.rb, but we don't want to break our actual # homebrew tree, and we do want to test everything :) @@ -24,12 +15,23 @@ HOMEBREW_REPOSITORY=HOMEBREW_PREFIX HOMEBREW_CACHE=HOMEBREW_PREFIX.parent+"cache" HOMEBREW_CELLAR=HOMEBREW_PREFIX.parent+"cellar" HOMEBREW_USER_AGENT="Homebrew" +HOMEBREW_WWW='http://example.com' MACOS_VERSION=10.6 (HOMEBREW_PREFIX+'Library'+'Formula').mkpath Dir.chdir HOMEBREW_PREFIX at_exit { HOMEBREW_PREFIX.parent.rmtree } +require 'utils' +require 'hardware' +require 'formula' +require 'download_strategy' +require 'keg' +require 'utils' +require 'brew.h' +require 'hardware' +require 'update' + # for some reason our utils.rb safe_system behaves completely differently # during these tests. This is worrying for sure. def safe_system *args @@ -250,16 +250,22 @@ rescue SystemExit rescue Interrupt => e puts # seemingly a newline is typical exit 130 +rescue BuildError => e + ohai "Backtrace" + puts e.backtrace + ohai "Environment" + dump_config + puts "Exit status: #{e.status}" + onoe e + puts PLEASE_REPORT_BUG + exit 1 +rescue RuntimeError, SystemCallError => e + onoe e + puts e.backtrace if ARGV.debug? + exit 1 rescue Exception => e - fatal = !(RuntimeError === e or SystemCallError === e) - onoe e - if BuildError === e or fatal - puts "#{Tty.white}Please report this bug to #{Tty.em}#{HOMEBREW_WWW}#{Tty.reset}" - dump_config - puts "Exit status: #{e.status}" if BuildError === e - end - puts e.backtrace if fatal or ARGV.debug? - + puts PLEASE_REPORT_BUG + puts e.backtrace exit 1 end |
