From ad8d5649a24b6438ceda0fe36aab82ef2428f5db Mon Sep 17 00:00:00 2001 From: Bojan Nikolic Date: Sat, 19 Aug 2017 22:16:35 +0100 Subject: set +u workaround for empty arrays libDirs can be empty, which in combination with "set -u" of 9f1e009975dc2d58541de435c74a26afe011542a will cause a variable unbound error on old bash versions --- pkgs/build-support/cc-wrapper/ld-wrapper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkgs/build-support/cc-wrapper') diff --git a/pkgs/build-support/cc-wrapper/ld-wrapper.sh b/pkgs/build-support/cc-wrapper/ld-wrapper.sh index d5fdc837cf5f..a775b6da8237 100644 --- a/pkgs/build-support/cc-wrapper/ld-wrapper.sh +++ b/pkgs/build-support/cc-wrapper/ld-wrapper.sh @@ -121,7 +121,7 @@ if [ "$NIX_@infixSalt@_DONT_SET_RPATH" != 1 ]; then # It's important to add the rpath in the order of -L..., so # the link time chosen objects will be those of runtime linking. declare -A rpaths - for dir in "${libDirs[@]}"; do + for dir in ${libDirs+"${libDirs[@]}"}; do if [[ "$dir" =~ [/.][/.] ]] && dir2=$(readlink -f "$dir"); then dir="$dir2" fi -- cgit 1.4.1