ci/bare-metal: Skip setting of unset variables at startup.
authorEric Anholt <eric@anholt.net>
Mon, 22 Jun 2020 23:54:10 +0000 (16:54 -0700)
committerMarge Bot <eric+marge@anholt.net>
Thu, 25 Jun 2020 17:33:28 +0000 (17:33 +0000)
It's silly to be setting (and logging the setting of!) all the env vars we
*didn't* set in a job.

Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5433>

.gitlab-ci/bare-metal/rootfs-setup.sh

index ba4cdf45bba6fe8e5e771b831ed83e0fc4102a69..ff86054c4e65c29761fcc643f8e5eacc91dac269 100644 (file)
@@ -39,7 +39,9 @@ for var in \
     VK_DRIVER \
     ; do
   val=`echo ${!var} | sed 's|"||g'`
-  echo "export $var=\"${val}\"" >> $rootfs_dst/set-job-env-vars.sh
+  if [ -n "$val" ]; then
+    echo "export $var=\"${val}\"" >> $rootfs_dst/set-job-env-vars.sh
+  fi
 done
 echo "Variables passed through:"
 cat $rootfs_dst/set-job-env-vars.sh