summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLucio Andrés Illanes Albornoz <lucio@lucioillanes.de>2020-05-15 09:51:13 +0100
committerLucio Andrés Illanes Albornoz <lucio@lucioillanes.de>2020-05-15 09:51:13 +0100
commit64c9461a9513839bae0b1e30013febc26fad1cec (patch)
tree0f8746266f31cb0986035fedcf79d12339febed5
parent8a4e16ff3484e7395112e1a8888ee7c8eb176987 (diff)
downloadmidipix_build-64c9461a9513839bae0b1e30013febc26fad1cec.tar.bz2
midipix_build-64c9461a9513839bae0b1e30013febc26fad1cec.tar.xz
subr/rtl.subr:rtl_set_IFS_nl(): initial implementation.
subr/pkg_install.subr:pkgp_install_perms(): use rtl_set_IFS_nl(). subr/rtl_complex.subr:rtl_filter_vars(): use rtl_set_IFS_nl().
-rw-r--r--subr/pkg_install.subr6
-rw-r--r--subr/rtl.subr2
-rw-r--r--subr/rtl_complex.subr5
3 files changed, 8 insertions, 5 deletions
diff --git a/subr/pkg_install.subr b/subr/pkg_install.subr
index f869ec5b..ee6c783c 100644
--- a/subr/pkg_install.subr
+++ b/subr/pkg_install.subr
@@ -3,9 +3,9 @@
#
pkgp_install_perms() {
- local _destdir="${1}" _fname="" _ifs_old="${IFS:- }" IFS;
- IFS="
-"; for _fname in $(find "${_destdir}" -type d); do
+ local _destdir="${1}" _fname="" IFS;
+ rtl_set_IFS_nl;
+ for _fname in $(find "${_destdir}" -type d); do
if ! rtl_fileop chmod 0755 "${_fname}"; then
return 1;
fi;
diff --git a/subr/rtl.subr b/subr/rtl.subr
index 103d6d5d..b123555f 100644
--- a/subr/rtl.subr
+++ b/subr/rtl.subr
@@ -4,6 +4,8 @@
rtl_basename() { local _fname="${1##*/}"; printf "%s" "${_fname}"; };
rtl_date() { command date "+${1:-${DEFAULT_TIMESTAMP_FMT:-"%Y/%m/%d %H:%M:%S"}}"; };
+rtl_set_IFS_nl() { IFS="
+"; };
rtl_set_var_unsafe() { [ -n "${2}" ] && eval ${1}=\"${2}\" || return 0; };
rtl_test_cmd() { command -v "${1}" >/dev/null; };
rtl_uniq() { if [ "${#}" -gt 0 ]; then printf "%s" "${*}" | sed 's/ /\n/g' | awk '!x[$0]++' | paste -s -d" "; fi; };
diff --git a/subr/rtl_complex.subr b/subr/rtl_complex.subr
index 4a055515..cb7c90bd 100644
--- a/subr/rtl_complex.subr
+++ b/subr/rtl_complex.subr
@@ -73,8 +73,9 @@ rtl_export_vars() {
};
rtl_filter_vars() {
- local _fn="${1}" _fnfl=0 _qchar="" _var_spec="" _vars="" _vname="" IFS="
-"; for _var_spec in $(set); do
+ local _fn="${1}" _fnfl=0 _qchar="" _var_spec="" _vars="" _vname="" IFS;
+ rtl_set_IFS_nl;
+ for _var_spec in $(set); do
case "${_qchar}" in
"\"") if [ "${_var_spec%\"}" != "${_var_spec}" ]; then
_qchar="";