diff options
| author | Jack Nagel | 2013-01-19 20:45:57 -0600 |
|---|---|---|
| committer | Jack Nagel | 2013-01-21 17:24:10 -0600 |
| commit | d06824c357a43cc2ecb5229784285cb30b037354 (patch) | |
| tree | cea48844d8340b7cd9116693e9f71720b207d243 /Library/Homebrew/extend | |
| parent | 3d92f1c683f08120d3779eff2c02b3a48ba6a84e (diff) | |
| download | brew-d06824c357a43cc2ecb5229784285cb30b037354.tar.bz2 | |
ENV.with_build_environment
Diffstat (limited to 'Library/Homebrew/extend')
| -rw-r--r-- | Library/Homebrew/extend/ENV.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Library/Homebrew/extend/ENV.rb b/Library/Homebrew/extend/ENV.rb index 095d05b70..6ac5a0db2 100644 --- a/Library/Homebrew/extend/ENV.rb +++ b/Library/Homebrew/extend/ENV.rb @@ -438,6 +438,14 @@ class << ENV self['PATH'] = paths.unshift(*self['PATH'].split(":")).uniq.join(":") end + def with_build_environment + old_env = to_hash + setup_build_environment + yield + ensure + replace(old_env) + end + def fortran fc_flag_vars = %w{FCFLAGS FFLAGS} |
