diff options
Diffstat (limited to 'subr')
-rw-r--r-- | subr/ex_pkg_env.subr | 5 | ||||
-rw-r--r-- | subr/ex_rtl.subr | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/subr/ex_pkg_env.subr b/subr/ex_pkg_env.subr index 5eff40ed..d3921e5f 100644 --- a/subr/ex_pkg_env.subr +++ b/subr/ex_pkg_env.subr @@ -50,9 +50,10 @@ ex_pkg_env() { esac; ;; esac; ;; esac; - for _vname in $(ex_split : ${PKG_ENV_VARS_EXTRA}); do + ex_push_IFS :; + for _vname in ${PKG_ENV_VARS_EXTRA}; do export "${_vname}"; - done; + done; ex_pop_IFS; if [ -n "${PKG_ENV_VARS}" ]\ && [ "${PKG_NO_LOG_VARS:-0}" -eq 0 ]; then PKG_ENV_VARS="$(echo "${PKG_ENV_VARS}" | tr " " "\n" | sort | tr "\n" " ")"; diff --git a/subr/ex_rtl.subr b/subr/ex_rtl.subr index b014a384..150b0f4d 100644 --- a/subr/ex_rtl.subr +++ b/subr/ex_rtl.subr @@ -2,7 +2,7 @@ # set -o errexit -o noglob are assumed. # -IFS_NL=" +EXP_IFS_NL=" "; ex_basename() { echo "${1##*/}"; }; @@ -10,7 +10,9 @@ ex_date() { command date "+${1:-${TIMESTAMP_FMT}}"; }; ex_dirname() { echo "${1%/*}"; }; ex_get_var_unsafe() { eval echo \${${1}}; }; ex_set_var_unsafe() { [ -n "${2}" ] && eval ${1}=\"${2}\" || return 0; }; -ex_split() { local IFS="${1}"; set -- $(echo "${2}"); IFS="${IFS_NL}"; echo "${*}"; }; +ex_pop_IFS() { IFS="${EXP_OLDIFS}"; }; +ex_push_IFS() { EXP_OLDIFS="${IFS}"; IFS="${1}"; }; +ex_push_IFS_nl() { ex_push_IFS "${EXP_IFS_NL}"; }; ex_test_cmd() { command -v "${1}" >/dev/null; }; ex_toupper() { echo "${1}" | tr a-z A-Z; }; |