diff --git a/pkgs/build-support/setup-hooks/multiple-outputs.sh b/pkgs/build-support/setup-hooks/multiple-outputs.sh index 8a62c57dbd07..45096d833b42 100644 --- a/pkgs/build-support/setup-hooks/multiple-outputs.sh +++ b/pkgs/build-support/setup-hooks/multiple-outputs.sh @@ -69,8 +69,8 @@ _multioutConfig() { # try to detect share/doc/${shareDocName} # Note: sadly, $configureScript detection comes later in configurePhase, # and reordering would cause more trouble than worth. - if [ -z "$shareDocName" ]; then - local confScript="$configureScript" + if [ -z "${shareDocName:-}" ]; then + local confScript="${configureScript:-}" if [ -z "$confScript" ] && [ -x ./configure ]; then confScript=./configure fi diff --git a/pkgs/build-support/setup-hooks/patch-shebangs.sh b/pkgs/build-support/setup-hooks/patch-shebangs.sh index e6872db1acd7..a22f989362c4 100644 --- a/pkgs/build-support/setup-hooks/patch-shebangs.sh +++ b/pkgs/build-support/setup-hooks/patch-shebangs.sh @@ -75,7 +75,7 @@ patchShebangs() { read -r oldInterpreterLine < "$f" read -r oldPath arg0 args <<< "${oldInterpreterLine:2}" - if [[ -z "$pathName" ]]; then + if [[ -z "${pathName:-}" ]]; then if [[ -n $strictDeps && $f == "$NIX_STORE"* ]]; then pathName=HOST_PATH else diff --git a/pkgs/build-support/setup-hooks/separate-debug-info.sh b/pkgs/build-support/setup-hooks/separate-debug-info.sh index 334db4cfcd9c..3a16ac4fee90 100644 --- a/pkgs/build-support/setup-hooks/separate-debug-info.sh +++ b/pkgs/build-support/setup-hooks/separate-debug-info.sh @@ -21,6 +21,9 @@ _separateDebugInfo() { while IFS= read -r -d $'\0' i; do if ! isELF "$i"; then continue; fi + [ -z "${READELF:-}" ] && echo "_separateDebugInfo: '\$READELF' variable is empty, skipping." 1>&2 && break + [ -z "${OBJCOPY:-}" ] && echo "_separateDebugInfo: '\$OBJCOPY' variable is empty, skipping." 1>&2 && break + # Extract the Build ID. FIXME: there's probably a cleaner way. local id="$($READELF -n "$i" | sed 's/.*Build ID: \([0-9a-f]*\).*/\1/; t; d')" if [ "${#id}" != 40 ]; then diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 7c948afc4dac..ad9857fc9d61 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -1216,7 +1216,7 @@ fixLibtool() { done sed -i "$1" \ - -e "s^eval \(sys_lib_search_path=\).*^\1'$search_path'^" \ + -e "s^eval \(sys_lib_search_path=\).*^\1'${search_path:-}'^" \ -e 's^eval sys_lib_.+search_path=.*^^' }