summaryrefslogtreecommitdiffhomepage
path: root/subr
diff options
context:
space:
mode:
authorLucio Andrés Illanes Albornoz (arab, vxp) <l.illanes@gmx.de>2017-02-05 23:36:57 +0100
committerLucio Andrés Illanes Albornoz (arab, vxp) <l.illanes@gmx.de>2017-02-05 23:36:57 +0100
commit51fbc32b57527b389ba533db097d0522ec04744c (patch)
treebb1afe56a398d9ff01fd9c4dde76cdbc14efe289 /subr
parentdc3ef505744355a22cbfed3f205107a8081adb4e (diff)
downloadmidipix_build-51fbc32b57527b389ba533db097d0522ec04744c.tar.bz2
midipix_build-51fbc32b57527b389ba533db097d0522ec04744c.tar.xz
build.sh, {subr,vars}/*: general cleanup.
Diffstat (limited to 'subr')
-rw-r--r--subr/build.subr18
-rw-r--r--subr/mode_check_updates.subr2
-rw-r--r--subr/pre_setup_env.subr2
3 files changed, 11 insertions, 11 deletions
diff --git a/subr/build.subr b/subr/build.subr
index 1341e973..afd76072 100644
--- a/subr/build.subr
+++ b/subr/build.subr
@@ -108,6 +108,15 @@ lfilter() {
echo ${_lnew};
};
+lmatch() {
+ local _cmp="${3}"; push_IFS "${2}"; set -- ${1}; pop_IFS;
+ while [ ${#} -gt 0 ]; do
+ if [ "${1}" = "${_cmp}" ]; then
+ return 0;
+ fi; shift;
+ done; return 1;
+};
+
log_env_vars() {
local _nvar _arg _arg_len_max;
log_msg info "Variables for this ${1:-build}:"; shift;
@@ -148,15 +157,6 @@ log_msg() {
fi; [ ${_lvl} = failexit ] && exit 1 || return 0;
};
-match_list() {
- local _cmp="${3}"; push_IFS "${2}"; set -- ${1}; pop_IFS;
- while [ ${#} -gt 0 ]; do
- if [ "${1}" = "${_cmp}" ]; then
- return 0;
- fi; shift;
- done; return 1;
-};
-
run_cmd_unsplit() {
local _cmd="${1}" _cmdline _rc; shift;
while [ ${#} -gt 0 ]; do
diff --git a/subr/mode_check_updates.subr b/subr/mode_check_updates.subr
index 51cf707d..56423a5b 100644
--- a/subr/mode_check_updates.subr
+++ b/subr/mode_check_updates.subr
@@ -54,7 +54,7 @@ mode_check_pkg_updates() {
cu_url="$(get_var_unsafe PKG_${cu_NAME}_URL)";
cu_url_type="$(get_var_unsafe PKG_${cu_NAME}_URL_TYPE)";
. vars/check_updates.vars;
- if match_list "${CHECK_UPDATES_SKIP}" " " "${cu_name}"; then
+ if lmatch "${CHECK_UPDATES_SKIP}" " " "${cu_name}"; then
log_msg vnfo "Skipping \`${cu_name}' (set in \${CHECK_UPDATES_SKIP}.)";
return 0;
elif [ "${cu_url_type}" = "git" ]; then
diff --git a/subr/pre_setup_env.subr b/subr/pre_setup_env.subr
index 0f2c9442..b8e1faa6 100644
--- a/subr/pre_setup_env.subr
+++ b/subr/pre_setup_env.subr
@@ -12,7 +12,7 @@ pre_setup_env() {
[ -e ${__} ] && . ${__};
done;
for __ in $(export | sed -e 's/^export //' -e 's/=.*$//'); do
- if ! match_list "${CLEAR_ENV_VARS_EXCEPT}" " " "${__}"; then
+ if ! lmatch "${CLEAR_ENV_VARS_EXCEPT}" " " "${__}"; then
unset "${__}";
fi;
done;