From: Eric Engestrom Date: Wed, 19 Aug 2020 14:02:44 +0000 (+0200) Subject: gitlab-ci: fix testing whether a variable with a given name is set or not X-Git-Url: https://git.libre-soc.org/?p=mesa.git;a=commitdiff_plain;h=72fac11ca37c67a13225dbe8c04e73cdca36ae5f;hp=64fb3e6def2b71df2766fabfeddadcc732155775 gitlab-ci: fix testing whether a variable with a given name is set or not The previous code considered unset variables the same as set-but-empty; sometimes setting a variable as something empty is meaningful, so let's pass them through properly. Signed-off-by: Eric Engestrom Reviewed-by: Eric Anholt Part-of: --- diff --git a/.gitlab-ci/bare-metal/rootfs-setup.sh b/.gitlab-ci/bare-metal/rootfs-setup.sh index 90e9bbf9ebe..220968aa057 100644 --- a/.gitlab-ci/bare-metal/rootfs-setup.sh +++ b/.gitlab-ci/bare-metal/rootfs-setup.sh @@ -50,7 +50,7 @@ for var in \ VK_DRIVER \ ; do val=`echo ${!var} | sed 's|"||g'` - if [ -n "$val" ]; then + if [ -n "${!var+x}" ]; then echo "export $var=\"${val}\"" >> $rootfs_dst/set-job-env-vars.sh fi done