diff options
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r-- | pkgs/stdenv/generic/setup.sh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 7168ce4084c87..a73474c952e50 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -157,7 +157,8 @@ addToSearchPathWithCustomDelimiter() { local delimiter="$1" local varName="$2" local dir="$3" - if [ -d "$dir" ]; then + if [[ -d "$dir" && "${!varName:+${delimiter}${!varName}${delimiter}}" \ + != *"${delimiter}${dir}${delimiter}"* ]]; then export "${varName}=${!varName:+${!varName}${delimiter}}${dir}" fi } |