summaryrefslogtreecommitdiff
path: root/scripts/functions
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/functions')
-rw-r--r--scripts/functions10
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/functions b/scripts/functions
index 272f368..ab235d8 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -1026,9 +1026,15 @@ CT_DoConfigSub() {
# Normally, each step is executed in a sub-shell and thus cannot modify the
# environment for the next step(s). When this is needed, it can do so by
# invoking this function.
-# Usage: CT_EnvModify VAR VALUE
+# Usage: CT_EnvModify [export] VAR VALUE
CT_EnvModify() {
- echo "${1}=\"${2}\"" >> "${CT_BUILD_DIR}/env.modify.sh"
+ local e
+ if [ "$1" = "export" ]; then
+ shift
+ e="export "
+ fi
+ eval "${e}${1}=\"${2}\""
+ echo "${e}${1}=\"${2}\"" >> "${CT_BUILD_DIR}/env.modify.sh"
}
# Compute the target tuple from what is provided by the user