From 65e719db25290653f3953eca76897bbb1ba746e2 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 15 Dec 2017 10:05:43 +0000 Subject: [PATCH] post_install: use HOMEBREW_PATH. Do this instead of appending the `HOMEBREW_PREFIX` as it's more reliable at finding e.g. keg-only and requirement PATH additions. It's not ideal as it overrides some environment filtering but the only real alternative is recreate the entire build environment by shelling out to `build.rb` in `formula_installer`. --- Library/Homebrew/formula.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index ef545421a5..8e4f80260b 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -956,16 +956,13 @@ class Formula @prefix_returns_versioned_prefix = true build = self.build self.build = Tab.for_formula(self) - path_with_prefix = PATH.new(ENV["PATH"]) - .append(HOMEBREW_PREFIX/"bin") - .append(HOMEBREW_PREFIX/"sbin") new_env = { "TMPDIR" => HOMEBREW_TEMP, "TEMP" => HOMEBREW_TEMP, "TMP" => HOMEBREW_TEMP, "HOMEBREW_PATH" => nil, - "PATH" => path_with_prefix, + "PATH" => ENV["HOMEBREW_PATH"], } with_env(new_env) do