aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMax Howell2012-09-28 09:12:15 -0400
committerMax Howell2012-09-28 09:37:38 -0400
commit7a7591534538bca80fef0a2b4cbcf16c4d0052de (patch)
treefdd8619c818f3689b2d0a4304b66a7669834eeac /Library
parentcc932ca6681df313149985066f15a7bed516bc21 (diff)
downloadbrew-7a7591534538bca80fef0a2b4cbcf16c4d0052de.tar.bz2
Only handle build-errors when it's a build-error
Refs Homebrew/homebrew#15164.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/--config.rb7
-rw-r--r--Library/Homebrew/formula.rb33
2 files changed, 21 insertions, 19 deletions
diff --git a/Library/Homebrew/cmd/--config.rb b/Library/Homebrew/cmd/--config.rb
index 281b310cd..f72cbedff 100644
--- a/Library/Homebrew/cmd/--config.rb
+++ b/Library/Homebrew/cmd/--config.rb
@@ -112,6 +112,13 @@ module Homebrew extend self
puts "X11: #{describe_x11}"
end
+ def write_build_config f
+ $f = f
+ def Homebrew.puts(*foo); $f.puts(*foo); end
+ Homebrew.dump_build_config
+ class << Homebrew; undef :puts; end
+ end
+
def dump_verbose_config
puts "HOMEBREW_VERSION: #{HOMEBREW_VERSION}"
puts "HEAD: #{head}"
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 15acff3cd..5ba20b473 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -542,29 +542,24 @@ protected
f.write(rd.read) until rd.eof?
Process.wait
- raise unless $?.success?
- end
-
- removed_ENV_variables.each do |key, value|
- ENV[key] = value # ENV.kind_of? Hash # => false
- end if removed_ENV_variables
- rescue
- if f
- f.flush
- Kernel.system "/usr/bin/tail -n 5 #{logfn}" unless ARGV.verbose?
- require 'cmd/--config'
- $f = f
- def Homebrew.puts(*foo); $f.puts *foo end
- f.puts
- Homebrew.dump_build_config
- class << Homebrew; undef :puts end
- else
- puts "No logs recorded :(" unless ARGV.verbose?
+ unless $?.success?
+ unless ARGV.verbose?
+ f.flush
+ Kernel.system "/usr/bin/tail -n 5 #{logfn}"
+ end
+ f.puts
+ require 'cmd/--config'
+ Homebrew.write_build_config(f)
+ raise BuildError.new(self, cmd, args, $?)
+ end
end
- raise BuildError.new(self, cmd, args, $?)
+
ensure
f.close if f
+ removed_ENV_variables.each do |key, value|
+ ENV[key] = value
+ end if removed_ENV_variables
end
public