More tweaking of main exception handler output
This commit is contained in:
parent
6488212a54
commit
00e227ac46
@ -22,6 +22,7 @@
|
|||||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
FORMULA_META_FILES = %w[README ChangeLog COPYING LICENSE COPYRIGHT AUTHORS]
|
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
|
def __make url, name
|
||||||
require 'formula'
|
require 'formula'
|
||||||
|
@ -7,6 +7,21 @@ ABS__FILE__=File.expand_path(__FILE__)
|
|||||||
|
|
||||||
$:.push(File.expand_path(__FILE__+'/../..'))
|
$:.push(File.expand_path(__FILE__+'/../..'))
|
||||||
require 'extend/pathname'
|
require 'extend/pathname'
|
||||||
|
|
||||||
|
# these are defined in global.rb, but we don't want to break our actual
|
||||||
|
# homebrew tree, and we do want to test everything :)
|
||||||
|
HOMEBREW_PREFIX=Pathname.new '/private/tmp/testbrew/prefix'
|
||||||
|
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 'utils'
|
||||||
require 'hardware'
|
require 'hardware'
|
||||||
require 'formula'
|
require 'formula'
|
||||||
@ -17,19 +32,6 @@ require 'brew.h'
|
|||||||
require 'hardware'
|
require 'hardware'
|
||||||
require 'update'
|
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 :)
|
|
||||||
HOMEBREW_PREFIX=Pathname.new '/private/tmp/testbrew/prefix'
|
|
||||||
HOMEBREW_REPOSITORY=HOMEBREW_PREFIX
|
|
||||||
HOMEBREW_CACHE=HOMEBREW_PREFIX.parent+"cache"
|
|
||||||
HOMEBREW_CELLAR=HOMEBREW_PREFIX.parent+"cellar"
|
|
||||||
HOMEBREW_USER_AGENT="Homebrew"
|
|
||||||
MACOS_VERSION=10.6
|
|
||||||
|
|
||||||
(HOMEBREW_PREFIX+'Library'+'Formula').mkpath
|
|
||||||
Dir.chdir HOMEBREW_PREFIX
|
|
||||||
at_exit { HOMEBREW_PREFIX.parent.rmtree }
|
|
||||||
|
|
||||||
# for some reason our utils.rb safe_system behaves completely differently
|
# for some reason our utils.rb safe_system behaves completely differently
|
||||||
# during these tests. This is worrying for sure.
|
# during these tests. This is worrying for sure.
|
||||||
def safe_system *args
|
def safe_system *args
|
||||||
|
26
bin/brew
26
bin/brew
@ -250,16 +250,22 @@ rescue SystemExit
|
|||||||
rescue Interrupt => e
|
rescue Interrupt => e
|
||||||
puts # seemingly a newline is typical
|
puts # seemingly a newline is typical
|
||||||
exit 130
|
exit 130
|
||||||
rescue Exception => e
|
rescue BuildError => e
|
||||||
fatal = !(RuntimeError === e or SystemCallError === e)
|
ohai "Backtrace"
|
||||||
|
puts e.backtrace
|
||||||
onoe e
|
ohai "Environment"
|
||||||
if BuildError === e or fatal
|
|
||||||
puts "#{Tty.white}Please report this bug to #{Tty.em}#{HOMEBREW_WWW}#{Tty.reset}"
|
|
||||||
dump_config
|
dump_config
|
||||||
puts "Exit status: #{e.status}" if BuildError === e
|
puts "Exit status: #{e.status}"
|
||||||
end
|
onoe e
|
||||||
puts e.backtrace if fatal or ARGV.debug?
|
puts PLEASE_REPORT_BUG
|
||||||
|
exit 1
|
||||||
|
rescue RuntimeError, SystemCallError => e
|
||||||
|
onoe e
|
||||||
|
puts e.backtrace if ARGV.debug?
|
||||||
|
exit 1
|
||||||
|
rescue Exception => e
|
||||||
|
onoe e
|
||||||
|
puts PLEASE_REPORT_BUG
|
||||||
|
puts e.backtrace
|
||||||
exit 1
|
exit 1
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user