Make ENV changes in the child so we don't have to roll them back
This commit is contained in:
parent
0ec7e39287
commit
56feb978b8
@ -558,7 +558,6 @@ class Formula
|
|||||||
# Pretty titles the command and buffers stdout/stderr
|
# Pretty titles the command and buffers stdout/stderr
|
||||||
# Throws if there's an error
|
# Throws if there's an error
|
||||||
def system cmd, *args
|
def system cmd, *args
|
||||||
removed_ENV_variables = {}
|
|
||||||
rd, wr = IO.pipe
|
rd, wr = IO.pipe
|
||||||
|
|
||||||
# remove "boring" arguments so that the important ones are more likely to
|
# remove "boring" arguments so that the important ones are more likely to
|
||||||
@ -570,10 +569,6 @@ class Formula
|
|||||||
end
|
end
|
||||||
ohai "#{cmd} #{pretty_args*' '}".strip
|
ohai "#{cmd} #{pretty_args*' '}".strip
|
||||||
|
|
||||||
if cmd.to_s.start_with? "xcodebuild"
|
|
||||||
removed_ENV_variables.update(ENV.remove_cc_etc)
|
|
||||||
end
|
|
||||||
|
|
||||||
@exec_count ||= 0
|
@exec_count ||= 0
|
||||||
@exec_count += 1
|
@exec_count += 1
|
||||||
logd = HOMEBREW_LOGS/name
|
logd = HOMEBREW_LOGS/name
|
||||||
@ -582,6 +577,12 @@ class Formula
|
|||||||
|
|
||||||
fork do
|
fork do
|
||||||
ENV['HOMEBREW_CC_LOG_PATH'] = logfn
|
ENV['HOMEBREW_CC_LOG_PATH'] = logfn
|
||||||
|
|
||||||
|
# TODO system "xcodebuild" is deprecated, this should be removed soon.
|
||||||
|
if cmd.to_s.start_with? "xcodebuild"
|
||||||
|
ENV.remove_cc_etc
|
||||||
|
end
|
||||||
|
|
||||||
rd.close
|
rd.close
|
||||||
$stdout.reopen wr
|
$stdout.reopen wr
|
||||||
$stderr.reopen wr
|
$stderr.reopen wr
|
||||||
@ -613,7 +614,6 @@ class Formula
|
|||||||
end
|
end
|
||||||
ensure
|
ensure
|
||||||
rd.close unless rd.closed?
|
rd.close unless rd.closed?
|
||||||
ENV.update(removed_ENV_variables)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user