formula: always override user home

Closes Homebrew/homebrew#40444.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Dominyk Tiller 2015-06-05 22:35:08 +01:00 committed by Mike McQuaid
parent b9cdfe21fc
commit ac523bac06

View File

@ -946,8 +946,17 @@ class Formula
def stage
active_spec.stage do
@buildpath = Pathname.pwd
env_home = buildpath/".brew_home"
mkdir_p env_home
old_home, ENV["HOME"] = ENV["HOME"], env_home
begin
yield
ensure
@buildpath = nil
ENV["HOME"] = old_home
end
end
end