mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-23 14:41:31 +02:00
Merge pull request #550 from marineam/export
enter_chroot: do not export variables that weren't previously exported
This commit is contained in:
commit
ad6bb62866
@ -394,7 +394,11 @@ CHROOT_PASSTHRU=(
|
|||||||
# Add the whitelisted environment variables to CHROOT_PASSTHRU.
|
# Add the whitelisted environment variables to CHROOT_PASSTHRU.
|
||||||
load_environment_whitelist
|
load_environment_whitelist
|
||||||
for var in "${ENVIRONMENT_WHITELIST[@]}" ; do
|
for var in "${ENVIRONMENT_WHITELIST[@]}" ; do
|
||||||
[ "${!var+set}" = "set" ] && CHROOT_PASSTHRU+=( "${var}=${!var}" )
|
# skip empty/unset values
|
||||||
|
[[ "${!var+set}" == "set" ]] || continue
|
||||||
|
# skip values that aren't actually exported
|
||||||
|
[[ $(declare -p "${var}") == "declare -x ${var}="* ]] || continue
|
||||||
|
CHROOT_PASSTHRU+=( "${var}=${!var}" )
|
||||||
done
|
done
|
||||||
|
|
||||||
# Set up GIT_PROXY_COMMAND so git:// URLs automatically work behind a proxy.
|
# Set up GIT_PROXY_COMMAND so git:// URLs automatically work behind a proxy.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user