summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xbuild.sh8
-rw-r--r--subr/ex_pkg_dispatch.subr20
2 files changed, 17 insertions, 11 deletions
diff --git a/build.sh b/build.sh
index 338a9b5f..9937a56f 100755
--- a/build.sh
+++ b/build.sh
@@ -3,7 +3,7 @@
#
buildp_ast() {
- local _param="${1}" _pids="" _pids_niter=0 RTL_KILL_TREE_PIDS="";
+ local _param="${1}" _pids="" _pids_niter=0 _pkg_name="" RTL_KILL_TREE_PIDS="";
if [ "${_param}" = "abort" ]; then
rtl_log_msg failexit "Build aborted.";
fi;
@@ -22,6 +22,12 @@ buildp_ast() {
if [ -n "${_pids}" ]; then
rtl_log_msg vnfo "Killed PIDs ${_pids}";
fi;
+ if [ -n "${EX_PKG_DISPATCH_WAIT}" ]; then
+ for _pkg_name in ${EX_PKG_DISPATCH_WAIT}; do
+ rtl_state_clear "${BUILD_WORKDIR}" "${_pkg_name}";
+ done;
+ rtl_log_msg vnfo "Reset package state for: ${EX_PKG_DISPATCH_WAIT}";
+ fi;
};
buildp_dispatch_fail_pkg() {
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..."\