summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2019-10-31 13:53:36 +0200
committerMartin Storsjö <martin@martin.st>2019-11-01 08:38:56 +0000
commitab17119d98ea15a44c50e28701b6993a0a071f5e (patch)
tree37b5da1f38a8a14b8014b388cef0bdc74fe89119
parent0f705dfe46a02d288468fb34556063be73b7134e (diff)
downloadmidipix_build-ab17119d98ea15a44c50e28701b6993a0a071f5e.tar.bz2
midipix_build-ab17119d98ea15a44c50e28701b6993a0a071f5e.tar.xz
Cope with long environment variables that are wrapped over multiple lines
The TERMCAP variable, if present, can be very long (27 lines and over 1500 chars in my case). In these cases, the earlier lines end with a backslash, and the following ones start with a one tab indent. Filter for lines starting with "export" to properly find the variable names only, as that's the only thing we're interested in here.
-rw-r--r--subr/build_init.subr2
1 files changed, 1 insertions, 1 deletions
diff --git a/subr/build_init.subr b/subr/build_init.subr
index 0634e33b..310585fa 100644
--- a/subr/build_init.subr
+++ b/subr/build_init.subr
@@ -47,7 +47,7 @@ build_init() {
DEFAULT_GIT_ARGS="-6${DEFAULT_GIT_ARGS:+ ${DEFAULT_GIT_ARGS}}";
DEFAULT_WGET_ARGS="-6${DEFAULT_WGET_ARGS:+ ${DEFAULT_WGET_ARGS}}";
fi;
- _env_vars="$(export | sed -e 's/^export //' -e 's/=.*$//')";
+ _env_vars="$(export | grep ^export | sed -e 's/^export //' -e 's/=.*$//')";
_env_vars_except="${DEFAULT_CLEAR_ENV_VARS_EXCEPT}";
for _env_var in ${_env_vars}; do
if [ "${_env_var#DEFAULT_}" != "${_env_var}" ]\