diff options
| author | Dominyk Tiller | 2015-06-05 22:35:08 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2015-07-18 20:48:00 -0700 |
| commit | ac523bac06c97775420f7e5cb4c1922ce794ac14 (patch) | |
| tree | b61b98e6af1c4ff5b12bc83e78820343b76665db /Library/Homebrew | |
| parent | b9cdfe21fc7c1dbfa2f6ce7a087a47556dfff5df (diff) | |
| download | brew-ac523bac06c97775420f7e5cb4c1922ce794ac14.tar.bz2 | |
formula: always override user home
Closes Homebrew/homebrew#40444.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/formula.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index fc378b819..48ac4781f 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -946,8 +946,17 @@ class Formula def stage active_spec.stage do @buildpath = Pathname.pwd - yield - @buildpath = nil + 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 |
