mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 07:20:10 +01:00
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 <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35421>
This commit is contained in:
parent
d77166edec
commit
655cf2f553
1 changed files with 1 additions and 2 deletions
|
|
@ -352,7 +352,6 @@ function filter_env_vars() {
|
||||||
env -0 | sort -z | while IFS= read -r -d '' line; do
|
env -0 | sort -z | while IFS= read -r -d '' line; do
|
||||||
[[ "$line" == *=* ]] || continue
|
[[ "$line" == *=* ]] || continue
|
||||||
local varname="${line%%=*}"
|
local varname="${line%%=*}"
|
||||||
local value="${line#*=}"
|
|
||||||
|
|
||||||
# Skip certain Mesa-specific variables
|
# Skip certain Mesa-specific variables
|
||||||
if echo "$varname" | grep -qxE "$CI_EXCLUDE_ENV_VAR_REGEX"; then
|
if echo "$varname" | grep -qxE "$CI_EXCLUDE_ENV_VAR_REGEX"; then
|
||||||
|
|
@ -369,7 +368,7 @@ function filter_env_vars() {
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "export %s=%s\n" "$varname" "${value@Q}"
|
echo "${!varname@A}"
|
||||||
done
|
done
|
||||||
x_restore
|
x_restore
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue