build: use with_env helper

This commit is contained in:
Misty De Meo 2017-07-15 17:26:42 -07:00
parent 610af15f0e
commit 8e645dfbec
No known key found for this signature in database
GPG Key ID: 76CF846A2F674B2C

View File

@ -102,11 +102,13 @@ class Build
end
end
old_tmpdir = ENV["TMPDIR"]
old_temp = ENV["TEMP"]
old_tmp = ENV["TMP"]
ENV["TMPDIR"] = ENV["TEMP"] = ENV["TMP"] = HOMEBREW_TEMP
new_env = {
"TMPDIR" => HOMEBREW_TEMP,
"TEMP" => HOMEBREW_TEMP,
"TMP" => HOMEBREW_TEMP,
}
with_env(new_env) do
formula.extend(Debrew::Formula) if ARGV.debug?
formula.brew do |_formula, staging|
@ -145,10 +147,7 @@ class Build
formula.prefix.install_metafiles formula.libexec if formula.libexec.exist?
end
end
ensure
ENV["TMPDIR"] = old_tmpdir
ENV["TEMP"] = old_temp
ENV["TMP"] = old_tmp
end
end
def detect_stdlibs(compiler)