Mesa (master): gitlab-ci: fix quoting of variables passed down to bare-metal runners

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Aug 19 22:09:19 UTC 2020


Module: Mesa
Branch: master
Commit: b5d36e9cb6c73c6e4eea4df247ded96535abae18
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b5d36e9cb6c73c6e4eea4df247ded96535abae18

Author: Eric Engestrom <eric at engestrom.ch>
Date:   Wed Aug 19 00:47:16 2020 +0200

gitlab-ci: fix quoting of variables passed down to bare-metal runners

Eric Anholt identified the issue when merging one of my MRs: the
variable contained words in '`' backticks, which caused them to be
executed by the bare metal runner's shell.

Quote the value printed using bash's shell expansion feature to make
sure anything in the future will be properly quoted.

Signed-off-by: Eric Engestrom <eric at engestrom.ch>
Reviewed-by: Eric Anholt <eric at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6389>

---

 .gitlab-ci/bare-metal/rootfs-setup.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/.gitlab-ci/bare-metal/rootfs-setup.sh b/.gitlab-ci/bare-metal/rootfs-setup.sh
index 220968aa057..27a5c40de2e 100644
--- a/.gitlab-ci/bare-metal/rootfs-setup.sh
+++ b/.gitlab-ci/bare-metal/rootfs-setup.sh
@@ -49,9 +49,8 @@ for var in \
     TU_DEBUG \
     VK_DRIVER \
     ; do
-  val=`echo ${!var} | sed 's|"||g'`
   if [ -n "${!var+x}" ]; then
-    echo "export $var=\"${val}\"" >> $rootfs_dst/set-job-env-vars.sh
+    echo "export $var=${!var at Q}" >> $rootfs_dst/set-job-env-vars.sh
   fi
 done
 echo "Variables passed through:"



More information about the mesa-commit mailing list