setup.sh: make sure initialPath goes at end of HOST_PATH
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.
This commit is contained in:
parent
a1533dfc41
commit
ec7d72a57d
@ -182,10 +182,8 @@ addToSearchPathWithCustomDelimiter() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
PATH_DELIMITER=':'
|
|
||||||
|
|
||||||
addToSearchPath() {
|
addToSearchPath() {
|
||||||
addToSearchPathWithCustomDelimiter "${PATH_DELIMITER}" "$@"
|
addToSearchPathWithCustomDelimiter ":" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Add $1/lib* into rpaths.
|
# Add $1/lib* into rpaths.
|
||||||
@ -508,7 +506,7 @@ activatePackage() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$hostOffset" -eq 0 && -d "$pkg/bin" ]]; then
|
if [[ "$hostOffset" -eq 0 && -d "$pkg/bin" ]]; then
|
||||||
addToSearchPath HOST_PATH "$pkg/bin"
|
addToSearchPath _HOST_PATH "$pkg/bin"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f "$pkg/nix-support/setup-hook" ]]; then
|
if [[ -f "$pkg/nix-support/setup-hook" ]]; then
|
||||||
@ -617,10 +615,15 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
PATH="${_PATH-}${_PATH:+${PATH:+:}}$PATH"
|
PATH="${_PATH-}${_PATH:+${PATH:+:}}$PATH"
|
||||||
|
HOST_PATH="${_HOST_PATH-}${_HOST_PATH:+${HOST_PATH:+:}}$HOST_PATH"
|
||||||
if (( "${NIX_DEBUG:-0}" >= 1 )); then
|
if (( "${NIX_DEBUG:-0}" >= 1 )); then
|
||||||
echo "final path: $PATH"
|
echo "final path: $PATH"
|
||||||
|
echo "final host path: $HOST_PATH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
unset _PATH
|
||||||
|
unset _HOST_PATH
|
||||||
|
|
||||||
|
|
||||||
# Make GNU Make produce nested output.
|
# Make GNU Make produce nested output.
|
||||||
export NIX_INDENT_MAKE=1
|
export NIX_INDENT_MAKE=1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user