diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb index add29a2f07..a25a36f563 100644 --- a/Library/Homebrew/exceptions.rb +++ b/Library/Homebrew/exceptions.rb @@ -147,9 +147,9 @@ end class BuildError < Homebrew::InstallationError attr_reader :command, :env - def initialize formula, cmd, args + def initialize(formula, cmd, args, env) @command = cmd - @env = ENV.to_hash + @env = env args = args.map{ |arg| arg.to_s.gsub " ", "\\ " }.join(" ") super formula, "Failed executing: #{command} #{args}" end diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 59e81ad32f..67ed06661b 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -545,7 +545,7 @@ class Formula log.puts require 'cmd/config' Homebrew.dump_build_config(log) - raise BuildError.new(self, cmd, args) + raise BuildError.new(self, cmd, args, ENV.to_hash) end ensure log.close unless log.closed?