aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/formula.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/formula.rb')
-rw-r--r--Library/Homebrew/formula.rb33
1 files changed, 14 insertions, 19 deletions
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