diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2018-11-14 14:17:03 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2018-11-26 10:44:43 +0000 |
commit | d993e2699ac3a33a416bba0058f5bda8158fa309 (patch) | |
tree | 459ca47930d1f640110227f89f7dc9efd39f71b6 /tcwg-buildfarm.sh | |
parent | 1aa722d8a8ff64bf600154a966321e994e4d012d (diff) |
Don't ignore "null" values in variable expansions
Replace ${var:-default} with ${var-default}.
I learned something new about shell scripting today. From bash manual:
===
When not performing substring expansion, using the form described
below (e.g., ‘:-’), Bash tests for a parameter that is unset or null.
Omitting the colon results in a test only for a parameter that is
unset. Put another way, if the colon is included, the operator tests
for both parameter’s existence and that its value is not null; if
the colon is omitted, the operator tests only for existence.
===
The immediate problem I need to fix is handling of
host_aarchXX_excludecheck and host_x86_64_excludecheck parameters
in tcwg-buildfarm.sh. With ":-" syntax the empty ("null") values are
replaced by defaults, causing GCC testsuite to be ignored on aarchXX
hosts when "--host_aarchXX_excludecheck ''" is given.
There happens to be a single usage ":-" in ${rw:-rw} in
start-container-qemu.sh, where ":-" is actually needed.
Change-Id: Ibc8e070b698e1c76e2161eb65d40639b8cdec1f3
Diffstat (limited to 'tcwg-buildfarm.sh')
-rwxr-xr-x | tcwg-buildfarm.sh | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/tcwg-buildfarm.sh b/tcwg-buildfarm.sh index c5709d6f..7fa08486 100755 --- a/tcwg-buildfarm.sh +++ b/tcwg-buildfarm.sh @@ -9,30 +9,30 @@ convert_args_to_variables "$@" # Make shellcheck happy and workaround Jenkins not defining variables # for empty arguments. -label="${label:-tcwg-x86_64-build}" -target="${target:-aarch64-linux-gnu}" -NODE_NAME="${NODE_NAME:-$(hostname)}" -TCWG_SES_USER="${TCWG_SES_USER:-}" -TCWG_SES_PASSWORD="${TCWG_SES_PASSWORD:-}" -WORKSPACE="${WORKSPACE:-$(pwd)}" -override="${override:-}" -host_x86_64_languages="${host_x86_64_languages:-default}" -host_aarchXX_languages="${host_aarchXX_languages:-c,c++}" -runtests="${runtests:-aarch64-linux-gnu}" -send_results_to="${send_results_to:-}" -try_bootstrap="${try_bootstrap:-true}" -host_x86_64_excludecheck="${host_x86_64_excludecheck:-gdb}" -host_aarchXX_excludecheck="${host_aarchXX_excludecheck:-gcc}" -extraconfig="${extraconfig:-}" -rebuild="${rebuild:-true}" -log_name="${log_name:-$target}" -dont_fail="${dont_fail:-false}" -log_server="${log_server:-dev-01.tcwglab:$HOME/logs}" -abe_branch="${abe_branch:-refs/heads/tested}" -build_container_tag="${build_container_tag:-xenial-tcwg-tested}" -test_container_tag="${test_container_tag:-xenial-tcwg-tested}" -binaries="${binaries:-false}" -dryrun="${dryrun:-false}" +label="${label-tcwg-x86_64-build}" +target="${target-aarch64-linux-gnu}" +NODE_NAME="${NODE_NAME-$(hostname)}" +TCWG_SES_USER="${TCWG_SES_USER-}" +TCWG_SES_PASSWORD="${TCWG_SES_PASSWORD-}" +WORKSPACE="${WORKSPACE-$(pwd)}" +override="${override-}" +host_x86_64_languages="${host_x86_64_languages-default}" +host_aarchXX_languages="${host_aarchXX_languages-c,c++}" +runtests="${runtests-aarch64-linux-gnu}" +send_results_to="${send_results_to-}" +try_bootstrap="${try_bootstrap-true}" +host_x86_64_excludecheck="${host_x86_64_excludecheck-gdb}" +host_aarchXX_excludecheck="${host_aarchXX_excludecheck-gcc}" +extraconfig="${extraconfig-}" +rebuild="${rebuild-true}" +log_name="${log_name-$target}" +dont_fail="${dont_fail-false}" +log_server="${log_server-dev-01.tcwglab:$HOME/logs}" +abe_branch="${abe_branch-refs/heads/tested}" +build_container_tag="${build_container_tag-xenial-tcwg-tested}" +test_container_tag="${test_container_tag-xenial-tcwg-tested}" +binaries="${binaries-false}" +dryrun="${dryrun-false}" # Jenkins doesn't define variables when parameter value is empty, # so enable "set -u" only after above binding of variables. |