From c843fd2f12cdff5d0309b1665bb5ad29ac1d8164 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sat, 28 Oct 2017 19:48:21 +0100 Subject: [PATCH] requirement: prepend rather than append PATH. Otherwise this ends up behind e.g. `/usr/bin` so is pretty useless. --- Library/Homebrew/requirement.rb | 2 +- Library/Homebrew/test/requirement_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/requirement.rb b/Library/Homebrew/requirement.rb index a69c68466b..c98ea95e87 100644 --- a/Library/Homebrew/requirement.rb +++ b/Library/Homebrew/requirement.rb @@ -95,7 +95,7 @@ class Requirement parent = satisfied_result_parent return unless parent return if PATH.new(ENV["PATH"]).include?(parent.to_s) - ENV.append_path("PATH", parent) + ENV.prepend_path("PATH", parent) end def env diff --git a/Library/Homebrew/test/requirement_spec.rb b/Library/Homebrew/test/requirement_spec.rb index 11a3da8f4e..2d0d86c862 100644 --- a/Library/Homebrew/test/requirement_spec.rb +++ b/Library/Homebrew/test/requirement_spec.rb @@ -138,7 +138,7 @@ describe Requirement do end it "infers path from #satisfy result" do - expect(ENV).to receive(:append_path).with("PATH", Pathname.new("/foo/bar")) + expect(ENV).to receive(:prepend_path).with("PATH", Pathname.new("/foo/bar")) subject.satisfied? subject.modify_build_environment end