aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/formula.rb
diff options
context:
space:
mode:
authorMike McQuaid2017-05-21 13:55:44 +0100
committerMike McQuaid2017-05-21 13:55:44 +0100
commitd89c870621fb78f3b9be4e0758031bcd6bbc3c31 (patch)
tree3ee586b81febbec19249338859e1959461a2df34 /Library/Homebrew/formula.rb
parent7000f50d5f79cb9c6b1e2d53a0cc9ec8283fd3ec (diff)
downloadbrew-d89c870621fb78f3b9be4e0758031bcd6bbc3c31.tar.bz2
formula: ensure HOMEBREW_PREFIX/bin in test PATH.
Only likely to kick in when environment filtering is enabled. Otherwise we need to tediously add a dramatic number of PATHs to tests or recurse through the runtime formulae dependencies and add all them. CC @ilovezfs
Diffstat (limited to 'Library/Homebrew/formula.rb')
-rw-r--r--Library/Homebrew/formula.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index d6ff2e134..d6ea0aeba 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -1673,11 +1673,13 @@ class Formula
old_temp = ENV["TEMP"]
old_tmp = ENV["TMP"]
old_term = ENV["TERM"]
- old_path = ENV["HOMEBREW_PATH"]
+ old_path = ENV["PATH"]
+ old_homebrew_path = ENV["HOMEBREW_PATH"]
ENV["CURL_HOME"] = old_curl_home || old_home
ENV["TMPDIR"] = ENV["TEMP"] = ENV["TMP"] = HOMEBREW_TEMP
ENV["TERM"] = "dumb"
+ ENV["PATH"] = PATH.new(old_path).append(HOMEBREW_PREFIX/"bin")
ENV["HOMEBREW_PATH"] = nil
ENV.clear_sensitive_environment!
@@ -1704,7 +1706,8 @@ class Formula
ENV["TEMP"] = old_temp
ENV["TMP"] = old_tmp
ENV["TERM"] = old_term
- ENV["HOMEBREW_PATH"] = old_path
+ ENV["PATH"] = old_path
+ ENV["HOMEBREW_PATH"] = old_homebrew_path
@prefix_returns_versioned_prefix = false
end