diff options
author | Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de> | 2021-05-07 17:12:29 +0100 |
---|---|---|
committer | Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de> | 2021-05-07 17:12:29 +0100 |
commit | 370e98db644d9cd75172205e4e472978e68e0990 (patch) | |
tree | 28c009461e87ea94ebad5ad55c48e1cbdd74a63b /subr.rtl | |
parent | 9d255dd37a449f7661fd8a73f58ea6102269851d (diff) | |
download | midipix_build-370e98db644d9cd75172205e4e472978e68e0990.tar.bz2 midipix_build-370e98db644d9cd75172205e4e472978e68e0990.tar.xz |
Implements extended -r syntax.
build.sh:buildp_ast(): only reset package build step state if ${ARG_RESET_PKG} is 1.
etc/{build.usage,README.md}: updated.
etc/build.usage.short, subr/build_init.subr: implement short help screen.
midipix.env: correctly escape multi-line variable assignment expressions.
subr.rtl/rtl_list.subr: updated.
subr.rtl/rtl_state.subr:rtl_state_set(): correctly implement invalidation.
subr.rtl/rtl_state.subr:rtl_state_test(): honour `LAST'.
subr/build_init.subr:buildp_init_getopts(): implements --reset-pkg.
subr/build_init.subr:buildp_{expand_restart_{at,recursive},process_restart_spec}(): initial implementation.
subr/ex_pkg_{dispatch,env}.subr: updated.
subr/ex_pkg_exec.subr:ex_pkg_exec(): honour `ALL' and `LAST'.
vars/gcc.vars: updated.
Diffstat (limited to 'subr.rtl')
-rw-r--r-- | subr.rtl/rtl_list.subr | 2 | ||||
-rw-r--r-- | subr.rtl/rtl_state.subr | 23 |
2 files changed, 13 insertions, 12 deletions
diff --git a/subr.rtl/rtl_list.subr b/subr.rtl/rtl_list.subr index 369d3b46..29abef2e 100644 --- a/subr.rtl/rtl_list.subr +++ b/subr.rtl/rtl_list.subr @@ -1,5 +1,7 @@ # # set +o errexit -o noglob -o nounset is assumed. +# N.B. Lists separated by SP, when passed to rtl_l*() w/ explicit IFS, +# must specify "<SP><VT>" as IFS. # rtl_lassign() { diff --git a/subr.rtl/rtl_state.subr b/subr.rtl/rtl_state.subr index 6d539563..203ec520 100644 --- a/subr.rtl/rtl_state.subr +++ b/subr.rtl/rtl_state.subr @@ -11,23 +11,22 @@ rtl_state_clear() { }; rtl_state_set() { - local _workdir="${1}" _pkg_fname="${2}" _done_fname_pfx=""; - _done_fname_pfx="${_workdir}/.${_pkg_fname}"; - shift 2; while [ ${#} -ge 1 ]; do - if [ -z "${1}" ]; then - shift; continue; - elif [ "${1#-}" != "${1}" ]; then - rtl_fileop rm "${_done_fname_pfx}.${1#-}"; - else - rtl_fileop touch "${_done_fname_pfx}.${1}"; - fi; - shift; done; + local _workdir="${1}" _pkg_fname="${2}" _build_step="${3}" \ + _done_fname_pfx="${1}/.${2}"; shift 3; + + rtl_fileop touch "${_done_fname_pfx}.${_build_step}"; + while [ ${#} -ge 1 ]; do + if [ "${#1}" -gt 0 ]; then + rtl_fileop rm "${_done_fname_pfx}.${1}"; + fi; shift; + done; }; 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}" ]; then + if [ -z "${_restart_at}" ]\ + || [ "${_restart_at}" = "LAST" ]; then rtl_fileop test "${_done_fname}"; elif [ "${_restart_at}" = "ALL" ]; then return 1; |