summaryrefslogtreecommitdiffhomepage
path: root/subr
diff options
context:
space:
mode:
authorLucio Andrés Illanes Albornoz <lucio@lucioillanes.de>2020-03-01 09:30:07 +0000
committerLucio Andrés Illanes Albornoz <lucio@lucioillanes.de>2020-03-01 09:30:07 +0000
commit725770754d9f53d5b41d876053a7a993b629472e (patch)
tree362feec1fa7eac9449de56cf2f40a12c0c1a1ab1 /subr
parent20c51cc04e993190dbeb33c1ac1cd392db0b3295 (diff)
downloadmidipix_build-725770754d9f53d5b41d876053a7a993b629472e.tar.bz2
midipix_build-725770754d9f53d5b41d876053a7a993b629472e.tar.xz
build.sh:buildp_ast(): reset package state of in-progress packages at EXIT signal time.
subr/ex_pkg_dispatch.subr: convert ${EXP_PKG_DISPATCH_WAIT} to unscoped global ${EX_PKG_DISPATCH_WAIT}.
Diffstat (limited to 'subr')
-rw-r--r--subr/ex_pkg_dispatch.subr20
1 files changed, 10 insertions, 10 deletions
diff --git a/subr/ex_pkg_dispatch.subr b/subr/ex_pkg_dispatch.subr
index 489ed634..ed860739 100644
--- a/subr/ex_pkg_dispatch.subr
+++ b/subr/ex_pkg_dispatch.subr
@@ -47,7 +47,7 @@ exp_pkg_dispatch_group() {
"${_dispatch_fn}" finish_pkg ${_pipe_msg#done };
EXP_PKG_COMPLETE="$(rtl_lconcat "${EXP_PKG_COMPLETE}" "${_pkg_name}")";
EXP_PKG_NAMES="$(rtl_lfilter "${EXP_PKG_NAMES}" "${_pkg_name}")";
- EXP_PKG_DISPATCH_WAIT="$(rtl_lfilter "${EXP_PKG_DISPATCH_WAIT}" "${_pkg_name}")";
+ EX_PKG_DISPATCH_WAIT="$(rtl_lfilter "${EX_PKG_DISPATCH_WAIT}" "${_pkg_name}")";
if [ -n "${EXP_PKG_NAMES}" ] && [ "${_rc}" -eq 0 ]; then
if [ "${EXP_PKG_DISPATCH_NJOBS}" -ne "${_njobs_max}" ]; then
exp_pkg_dispatch_packages "${_build_steps_default}" \
@@ -91,13 +91,13 @@ exp_pkg_dispatch_group() {
# @_restart_at: optional comma-separated list of build steps at which to rebuild or ALL
# @_workdir: pathname to build-specific temporary directory
#
-# Return: zero (0) on success, non-zero (>0) on failure, ${EXP_PKG_DISPATCH_NJOBS}, ${EXP_PKG_DISPATCH_COUNT}, ${EXP_PKG_NAMES}, and ${EXP_PKG_DISPATCH_WAIT} may be mutated post-return.
+# Return: zero (0) on success, non-zero (>0) on failure, ${EXP_PKG_DISPATCH_NJOBS}, ${EXP_PKG_DISPATCH_COUNT}, ${EXP_PKG_NAMES}, and ${EX_PKG_DISPATCH_WAIT} may be mutated post-return.
#
exp_pkg_dispatch_package() {
local _build_steps_default="${1}" _build_vars_default="${2}" _dispatch_fn="${3}" \
_group_name="${4}" _pkg_name="${5}" _restart_at="${6}" _workdir="${7}";
if "${_dispatch_fn}" start_pkg "${_group_name}" "${_pkg_name}" "$((${EXP_PKG_DISPATCH_COUNT}+1))" "${EXP_PKG_DISPATCH_COUNT_MAX}"; then
- : $((EXP_PKG_DISPATCH_NJOBS+=1)); : $((EXP_PKG_DISPATCH_COUNT+=1)); EXP_PKG_DISPATCH_WAIT="$(rtl_lconcat "${EXP_PKG_DISPATCH_WAIT}" "${_pkg_name}")";
+ : $((EXP_PKG_DISPATCH_NJOBS+=1)); : $((EXP_PKG_DISPATCH_COUNT+=1)); EX_PKG_DISPATCH_WAIT="$(rtl_lconcat "${EX_PKG_DISPATCH_WAIT}" "${_pkg_name}")";
(set +o errexit -o noglob; BUILD_IS_PARENT=0;
if ex_pkg_env "${_build_steps_default}" "${_build_vars_default}" \
"${_group_name}" "${_pkg_name}" "${_restart_at}" "${_workdir}"; then
@@ -123,7 +123,7 @@ exp_pkg_dispatch_package() {
# @_restart_recursive: optional flag specifiying either no dependency expansion (0,) dependency expansion (1,) dependency expansion and forcibly rebuild (2.)
# @_workdir: pathname to build-specific temporary directory
#
-# Return: zero (0) on success, non-zero (>0) on failure, ${EXP_PKG_DISPATCH_NJOBS}, ${EXP_PKG_DISPATCH_COUNT}, ${EXP_PKG_NAMES}, and ${EXP_PKG_DISPATCH_WAIT} may be mutated post-return.
+# Return: zero (0) on success, non-zero (>0) on failure, ${EXP_PKG_DISPATCH_NJOBS}, ${EXP_PKG_DISPATCH_COUNT}, ${EXP_PKG_NAMES}, and ${EX_PKG_DISPATCH_WAIT} may be mutated post-return.
#
exp_pkg_dispatch_packages() {
local _build_steps_default="${1}" _build_vars_default="${2}" _dispatch_fn="${3}" \
@@ -133,8 +133,8 @@ exp_pkg_dispatch_packages() {
for _njob in $(seq 1 $((${_njobs_max}-${EXP_PKG_DISPATCH_NJOBS}))); do
for _pkg_name in ${EXP_PKG_NAMES}; do
if ! rtl_lmatch "${_pkg_complete}" "${_pkg_name}"\
- && ! rtl_lmatch "${EXP_PKG_DISPATCH_WAIT}" "${_pkg_name}"\
- && ex_pkg_check_depends "${_pkg_complete}" "${_pkg_name}" "${EXP_PKG_DISPATCH_WAIT}" "${_restart_recursive}"; then
+ && ! rtl_lmatch "${EX_PKG_DISPATCH_WAIT}" "${_pkg_name}"\
+ && ex_pkg_check_depends "${_pkg_complete}" "${_pkg_name}" "${EX_PKG_DISPATCH_WAIT}" "${_restart_recursive}"; then
exp_pkg_dispatch_package "${_build_steps_default}" \
"${_build_vars_default}" "${_dispatch_fn}" \
"${_group_name}" "${_pkg_name}" "${_restart_at}" \
@@ -157,7 +157,7 @@ exp_pkg_dispatch_packages() {
# @_restart_recursive: optional flag specifiying either no dependency expansion (0,) dependency expansion (1,) dependency expansion and forcibly rebuild (2.)
# @_workdir: pathname to build-specific temporary directory
#
-# Return: zero (0) on success, non-zero (>0) on failure, ${EX_PKG_DISPATCH_UNKNOWN} mutated post-return.
+# Return: zero (0) on success, non-zero (>0) on failure, ${EX_PKG_DISPATCH_UNKNOWN} and ${EX_PKG_DISPATCH_WAIT} mutated post-return.
#
ex_pkg_dispatch() {
local _build_steps_default="${1}" _build_vars_default="${2}" _dispatch_fn="${3}" \
@@ -165,12 +165,12 @@ ex_pkg_dispatch() {
_restart_at="${8}" _restart_recursive="${9}" _workdir="${10}" \
_pkg_name="" _pkg_names="" _rc=0 \
EXP_PKG_COMPLETE EXP_PKG_DISABLED EXP_PKG_FINISHED EXP_PKG_DISPATCH_COUNT \
- EXP_PKG_DISPATCH_COUNT_MAX EXP_PKG_DISPATCH_NJOBS EXP_PKG_NAMES EXP_PKG_DISPATCH_WAIT;
- EX_PKG_DISPATCH_UNKNOWN="";
+ EXP_PKG_DISPATCH_COUNT_MAX EXP_PKG_DISPATCH_NJOBS EXP_PKG_NAMES;
+ EX_PKG_DISPATCH_UNKNOWN=""; EX_PKG_DISPATCH_WAIT="";
for _group_name in $(rtl_uniq $(rtl_lunfold_depends '${_name}_GROUP_DEPENDS' ${_group_names})); do
EXP_PKG_COMPLETE="" EXP_PKG_DISABLED="" EXP_PKG_FINISHED="";
EXP_PKG_DISPATCH_COUNT=0 EXP_PKG_DISPATCH_COUNT_MAX=0 EXP_PKG_DISPATCH_NJOBS=0;
- EXP_PKG_NAMES="" EXP_PKG_DISPATCH_WAIT="";
+ EXP_PKG_NAMES="" EX_PKG_DISPATCH_WAIT="";
if "${_dispatch_fn}" start_group "${_group_name}" ""; then
if rtl_fileop mkdir "${_workdir}"\
&& rtl_log_msg vnfo "Resolving \`${_group_name}' dependencies..."\