From 72fac11ca37c67a13225dbe8c04e73cdca36ae5f Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Wed, 19 Aug 2020 16:02:44 +0200 Subject: [PATCH] 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: --- .gitlab-ci/bare-metal/rootfs-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.30.2