From 655cf2f553508e15dd1eb20d682e68d03fad61de Mon Sep 17 00:00:00 2001 From: Guilherme Gallo Date: Mon, 9 Jun 2025 17:50:58 -0300 Subject: [PATCH] ci: Simplify filter_env_vars using indirect expansion Avoid parsing variable values manually by using `${!varname@A}`, which returns the exact declaration as stored in the bash session. Signed-off-by: Guilherme Gallo Part-of: --- .gitlab-ci/setup-test-env.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab-ci/setup-test-env.sh b/.gitlab-ci/setup-test-env.sh index 1572d850fa4..ee9b6d6f3a0 100644 --- a/.gitlab-ci/setup-test-env.sh +++ b/.gitlab-ci/setup-test-env.sh @@ -352,7 +352,6 @@ function filter_env_vars() { env -0 | sort -z | while IFS= read -r -d '' line; do [[ "$line" == *=* ]] || continue local varname="${line%%=*}" - local value="${line#*=}" # Skip certain Mesa-specific variables if echo "$varname" | grep -qxE "$CI_EXCLUDE_ENV_VAR_REGEX"; then @@ -369,7 +368,7 @@ function filter_env_vars() { continue fi - printf "export %s=%s\n" "$varname" "${value@Q}" + echo "${!varname@A}" done x_restore }