Merge pull request #72347 from NixOS/bash-no-undef-vars

treewide: `set -u` everywhere
This commit is contained in:
John Ericson
2019-11-04 19:52:33 -05:00
committed by GitHub
65 changed files with 95 additions and 134 deletions
@@ -20,17 +20,17 @@ cmakeConfigurePhase() {
export CTEST_PARALLEL_LEVEL=$NIX_BUILD_CORES
fi
if [ -z "$dontFixCmake" ]; then
if [ -z "${dontFixCmake-}" ]; then
fixCmakeFiles .
fi
if [ -z "$dontUseCmakeBuildDir" ]; then
if [ -z "${dontUseCmakeBuildDir-}" ]; then
mkdir -p build
cd build
cmakeDir=${cmakeDir:-..}
fi
if [ -z "$dontAddPrefix" ]; then
if [ -z "${dontAddPrefix-}" ]; then
cmakeFlags="-DCMAKE_INSTALL_PREFIX=$prefix $cmakeFlags"
fi
@@ -84,7 +84,7 @@ cmakeConfigurePhase() {
cmakeFlags="-DCMAKE_INSTALL_LOCALEDIR=${!outputLib}/share/locale $cmakeFlags"
# Dont build tests when doCheck = false
if [ -z "$doCheck" ]; then
if [ -z "${doCheck-}" ]; then
cmakeFlags="-DBUILD_TESTING=OFF $cmakeFlags"
fi
@@ -99,7 +99,7 @@ cmakeConfigurePhase() {
cmakeFlags="-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON $cmakeFlags"
cmakeFlags="-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON $cmakeFlags"
if [ "$buildPhase" = ninjaBuildPhase ]; then
if [ "${buildPhase-}" = ninjaBuildPhase ]; then
cmakeFlags="-GNinja $cmakeFlags"
fi
@@ -115,7 +115,7 @@ cmakeConfigurePhase() {
runHook postConfigure
}
if [ -z "$dontUseCmakeConfigure" -a -z "$configurePhase" ]; then
if [ -z "${dontUseCmakeConfigure-}" -a -z "${configurePhase-}" ]; then
setOutputFlags=
configurePhase=cmakeConfigurePhase
fi