From ec7d72a57d5ba18a35451b174e2f3c8d4a425b94 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sat, 2 Mar 2019 20:02:45 -0500 Subject: [PATCH] setup.sh: make sure initialPath goes at end of HOST_PATH MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We want initialPath to have lowest precedence. In addition, unset _PATH and _HOST_PATH as they shouldn’t be needed after final PATH and HOST_PATH are set. --- pkgs/stdenv/generic/setup.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 8dff35578071..6f1a654a38ac 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -182,10 +182,8 @@ addToSearchPathWithCustomDelimiter() { fi } -PATH_DELIMITER=':' - addToSearchPath() { - addToSearchPathWithCustomDelimiter "${PATH_DELIMITER}" "$@" + addToSearchPathWithCustomDelimiter ":" "$@" } # Add $1/lib* into rpaths. @@ -508,7 +506,7 @@ activatePackage() { fi if [[ "$hostOffset" -eq 0 && -d "$pkg/bin" ]]; then - addToSearchPath HOST_PATH "$pkg/bin" + addToSearchPath _HOST_PATH "$pkg/bin" fi if [[ -f "$pkg/nix-support/setup-hook" ]]; then @@ -617,10 +615,15 @@ fi PATH="${_PATH-}${_PATH:+${PATH:+:}}$PATH" +HOST_PATH="${_HOST_PATH-}${_HOST_PATH:+${HOST_PATH:+:}}$HOST_PATH" if (( "${NIX_DEBUG:-0}" >= 1 )); then echo "final path: $PATH" + echo "final host path: $HOST_PATH" fi +unset _PATH +unset _HOST_PATH + # Make GNU Make produce nested output. export NIX_INDENT_MAKE=1