From c2996ef5dde3d92943cc33794ed0837dd3834629 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Mon, 4 Sep 2023 23:22:33 -0300 Subject: [PATCH] scons: shellcheck setupHook --- .../tools/build-managers/scons/setup-hook.sh | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/pkgs/development/tools/build-managers/scons/setup-hook.sh b/pkgs/development/tools/build-managers/scons/setup-hook.sh index 67358ee843d1..bfd8f3cc07b9 100644 --- a/pkgs/development/tools/build-managers/scons/setup-hook.sh +++ b/pkgs/development/tools/build-managers/scons/setup-hook.sh @@ -1,3 +1,5 @@ +# shellcheck shell=bash disable=SC2206 + sconsBuildPhase() { runHook preBuild @@ -15,7 +17,7 @@ sconsBuildPhase() { $buildFlags ${buildFlagsArray[@]} ) - echoCmd 'build flags' "${flagsArray[@]}" + echoCmd 'scons build flags' "${flagsArray[@]}" scons "${flagsArray[@]}" runHook postBuild @@ -39,7 +41,7 @@ sconsInstallPhase() { ${installTargets:-install} ) - echoCmd 'install flags' "${flagsArray[@]}" + echoCmd 'scons install flags' "${flagsArray[@]}" scons "${flagsArray[@]}" runHook postInstall @@ -50,9 +52,9 @@ sconsCheckPhase() { if [ -z "${checkTarget:-}" ]; then if scons -n check >/dev/null 2>&1; then - checkTarget=check + checkTarget="check" elif scons -n test >/dev/null 2>&1; then - checkTarget=test + checkTarget="test" fi fi @@ -65,21 +67,21 @@ sconsCheckPhase() { ${checkFlagsArray[@]} ) - echoCmd 'check flags' "${flagsArray[@]}" + echoCmd 'scons check flags' "${flagsArray[@]}" scons "${flagsArray[@]}" fi runHook postCheck } -if [ -z "${buildPhase-}" ]; then +if [ -z "${dontUseSconsBuild-}" ] && [ -z "${buildPhase-}" ]; then buildPhase=sconsBuildPhase fi -if [ -z "${dontUseSconsInstall-}" -a -z "${installPhase-}" ]; then - installPhase=sconsInstallPhase -fi - -if [ -z "${checkPhase-}" ]; then +if [ -z "${dontUseSconsCheck-}" ] && [ -z "${checkPhase-}" ]; then checkPhase=sconsCheckPhase fi + +if [ -z "${dontUseSconsInstall-}" ] && [ -z "${installPhase-}" ]; then + installPhase=sconsInstallPhase +fi