diff options
author | Lucio Andrés Illanes Albornoz (arab, vxp) <lucio@lucioillanes.de> | 2017-12-15 13:28:16 +0000 |
---|---|---|
committer | Lucio Andrés Illanes Albornoz (arab, vxp) <lucio@lucioillanes.de> | 2017-12-15 13:28:16 +0000 |
commit | 3bb0a6b329d2451227a4c0bc6576000ce9605ee1 (patch) | |
tree | 943a80834896b9a63bc78f6787a485ea99a5f50c | |
parent | f9882b77990c36a45941b863e775001dc018b9f1 (diff) | |
download | midipix_build-3bb0a6b329d2451227a4c0bc6576000ce9605ee1.tar.bz2 midipix_build-3bb0a6b329d2451227a4c0bc6576000ce9605ee1.tar.xz |
subr/build_init.subr:build_init(): don't unset ${PKG_...} environment variables.
-rw-r--r-- | subr/build_init.subr | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/subr/build_init.subr b/subr/build_init.subr index 01002eb6..9ce0d1dc 100644 --- a/subr/build_init.subr +++ b/subr/build_init.subr @@ -9,7 +9,7 @@ build_fini() { }; build_init() { - local __; + local __ _env_vars _env_vars_except _env_var; set -o noglob; if [ -z "${DEFAULT_BUILD_CPUS}" ]\ && [ -e /proc/cpuinfo ]; then @@ -39,9 +39,14 @@ build_init() { elif [ ${ARG_IPV6_ONLY:-0} -eq 1 ]; then DEFAULT_WGET_ARGS="-6${DEFAULT_WGET_ARGS:+ ${DEFAULT_WGET_ARGS}}"; fi; - ex_rtl_unset_vars $(ex_rtl_lfilter_not \ - "$(export | sed -e 's/^export //' -e 's/=.*$//')" \ - "${DEFAULT_CLEAR_ENV_VARS_EXCEPT}"); + _env_vars="$(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#PKG_}" != "${_env_var}" ]; then + _env_vars_except="${_env_vars_except:+${_env_vars_except} }${_env_var}"; + fi; + done; + ex_rtl_unset_vars $(ex_rtl_lfilter_not "${_env_vars}" "${_env_vars_except}"); ex_rtl_fileop mkdir "${BUILD_DLCACHEDIR}" "${BUILD_WORKDIR}"; if [ -e "${DEFAULT_BUILD_STATUS_IN_PROGRESS_FNAME}" ]; then ex_rtl_log_msg failexit "Error: another build targeting this architecture and build type is currently in progress."; |