summaryrefslogtreecommitdiffhomepage
path: root/subr/ex_pkg_exec.subr
diff options
context:
space:
mode:
authorLucio Andrés Illanes Albornoz (arab, vxp) <lucio@lucioillanes.de>2017-12-22 18:40:49 +0000
committerLucio Andrés Illanes Albornoz (arab, vxp) <lucio@lucioillanes.de>2017-12-22 18:47:27 +0000
commit30ae149529f8ce02bee49c0706d67e677e44f24c (patch)
tree38b66fde3e76ef73606b80e1bdb2f282ffc5d7f5 /subr/ex_pkg_exec.subr
parent3b355c1f44adad46b0c1a16d29f7b0f12b0c029c (diff)
downloadmidipix_build-30ae149529f8ce02bee49c0706d67e677e44f24c.tar.bz2
midipix_build-30ae149529f8ce02bee49c0706d67e677e44f24c.tar.xz
build.sh:fail_pkg: terminate pending builds given build failure, -P, and absence of -R.
etc/build.usage: clarify the consequences of parallelising builds to guide the perplexed and to confuse the people of the tribe of certainty into enlightenment (or not?) subr/ex_pkg_dispatch.subr:exp_pkg_dispatch(): moved traps. subr/ex_pkg_exec.subr:ex_pkg_exec(): forcibly pkill(1) child processes on failure.
Diffstat (limited to 'subr/ex_pkg_exec.subr')
-rw-r--r--subr/ex_pkg_exec.subr6
1 files changed, 6 insertions, 0 deletions
diff --git a/subr/ex_pkg_exec.subr b/subr/ex_pkg_exec.subr
index ceb9579a..76294763 100644
--- a/subr/ex_pkg_exec.subr
+++ b/subr/ex_pkg_exec.subr
@@ -24,6 +24,12 @@ exp_pkg_exec_pre() {
ex_pkg_exec() {
local _pkg_name="${1}" _tgt_name="${2}" _restart_at="${3}" \
_step _step_cmd _step_cmd_pfx _step_rc;
+ trap "if [ \${?} -eq 0 ]; then \
+ echo \"done ${_pkg_name} ${_tgt_name}\" >&3; \
+ else \
+ echo \"fail ${_pkg_name} ${_tgt_name}\" >&3; \
+ pkill -U "${$}"; \
+ fi;" EXIT HUP INT TERM USR1 USR2;
exp_pkg_exec_pre "${_pkg_name}" "${_tgt_name}" "${_restart_at}";
"${_dispatch_fn}" exec_start "${_pkg_name}" "${_tgt_name}";
if ex_rtl_test_cmd "pkg_${_pkg_name}_all"; then