diff options
author | Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de> | 2021-05-10 15:26:25 +0100 |
---|---|---|
committer | Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de> | 2021-05-10 15:26:25 +0100 |
commit | 3e5303fb9ba19addfcb672c1f3aa78d02efb7ebc (patch) | |
tree | 448feaab5f16dcf1c450efebde18b0f56c3b0ebf /subr.rtl/rtl_state.subr | |
parent | e1a4743914675267e94b3510bea6d8c8c357a32e (diff) | |
download | midipix_build-3e5303fb9ba19addfcb672c1f3aa78d02efb7ebc.tar.bz2 midipix_build-3e5303fb9ba19addfcb672c1f3aa78d02efb7ebc.tar.xz |
Implements {fetch,configure,build,install}_clean.
build.sh:buildp_dispatch_fail_pkg(): print NL when writing to ${DEFAULT_BUILD_LAST_FAILED_PKG_FNAME}.
etc/{README.md,build.usage}: updated.
midipix.env: updated.
subr.rtl/rtl_complex.subr:rtl_sunset(): initial implementation.
subr.rtl/rtl_list.subr:rtl_l{filter[23],length2,lift[23]}(): initial implementation.
subr.rtl/rtl_state.subr:rtl_state_test(): take ${_build_steps} vs. ${_build_step}.
subr/{build_init,ex_pkg_restart}.subr: splits extended restart syntax processing logic.
subr/ex_pkg_exec.subr:ex_pkg_exec(): filter "start".
subr/pkg_{build,configure,fetch,install}_clean.subr: initial implementation.
Diffstat (limited to 'subr.rtl/rtl_state.subr')
-rw-r--r-- | subr.rtl/rtl_state.subr | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/subr.rtl/rtl_state.subr b/subr.rtl/rtl_state.subr index 203ec520..da091e9c 100644 --- a/subr.rtl/rtl_state.subr +++ b/subr.rtl/rtl_state.subr @@ -23,16 +23,22 @@ rtl_state_set() { }; rtl_state_test() { - local _workdir="${1}" _pkg_name="${2}" _build_step="${3}" _restart_at="${4:-}" _done_fname=""; - _done_fname="${_workdir}/.${_pkg_name}.${_build_step}"; - if [ -z "${_restart_at}" ]\ - || [ "${_restart_at}" = "LAST" ]; then - rtl_fileop test "${_done_fname}"; - elif [ "${_restart_at}" = "ALL" ]; then - return 1; - else - ! rtl_lmatch "${_restart_at}" "${_build_step}" ","; - fi; + local _workdir="${1}" _pkg_name="${2}" _build_steps="${3}" \ + _restart_at="${4:-}" _build_step="" _done_fname="" \ + IFS="," _rc=0; + + for _build_step in ${_build_steps}; do + _done_fname="${_workdir}/.${_pkg_name}.${_build_step}"; + if [ "${_restart_at:+1}" != 1 ]\ + || [ "${_restart_at}" = "LAST" ]; then + rtl_fileop test "${_done_fname}"; _rc="${?}"; + elif [ "${_restart_at}" = "ALL" ]; then + _rc=1; + else + rtl_lmatch "${_restart_at}" "${_build_step}" ","; + _rc=$((${?} ? 0 : 1)); + fi; [ "${_rc}" -eq 0 ] && break; + done; return "${_rc}"; }; # vim:filetype=sh |