From 9904ea2c76e246629fab8bda455eec07aa84f3f9 Mon Sep 17 00:00:00 2001 From: Cristian Ciocaltea Date: Wed, 23 Feb 2022 13:43:48 +0200 Subject: [PATCH] ci: Convert generate-env.sh to a POSIX compliant script This shell script will be used in environments (e.g. LAVA) where bash is not available, hence let's make sure it is POSIX compliant in order to be able to execute on any modern shell interpreter. Signed-off-by: Cristian Ciocaltea Reviewed-by: Guilherme Gallo Reviewed-by: Tomeu Vizoso Part-of: --- .gitlab-ci/common/generate-env.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci/common/generate-env.sh b/.gitlab-ci/common/generate-env.sh index 937ab8ea6d0..58e92490381 100755 --- a/.gitlab-ci/common/generate-env.sh +++ b/.gitlab-ci/common/generate-env.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh for var in \ ASAN_OPTIONS \ @@ -106,8 +106,8 @@ for var in \ VK_CPU \ VK_DRIVER \ VK_ICD_FILENAMES \ - ; do - if [ -n "${!var+x}" ]; then - echo "export $var=${!var@Q}" - fi + ; +do + eval val=\$${var} + [ -z "$val" ] || echo "export $var='$val'" done