summaryrefslogtreecommitdiffhomepage
path: root/subr/ex_pkg_dispatch.subr
diff options
context:
space:
mode:
authorLucio Andrés Illanes Albornoz <lucio@lucioillanes.de>2020-02-14 13:00:38 +0000
committerLucio Andrés Illanes Albornoz <lucio@lucioillanes.de>2020-02-14 13:00:38 +0000
commitebda8bb2b1103bfe79ba7196832f4c0b2b5caffd (patch)
tree562b7460470dd345137d041694fcbb7f8dac74d4 /subr/ex_pkg_dispatch.subr
parentae3ff05d44d48ca824347bdbd6b823a9720b1a0c (diff)
downloadmidipix_build-ebda8bb2b1103bfe79ba7196832f4c0b2b5caffd.tar.bz2
midipix_build-ebda8bb2b1103bfe79ba7196832f4c0b2b5caffd.tar.xz
build.sh: minor cleanup.
groups/2*.native_packages_*.group: adds dependencies. subr/{build_init,ex_pkg_dispatch}.subr, etc/build.usage: forcibly rebuild all dependencies w/ -r **[ ...] vs. -r *[ ... ]. subr/ex_pkg_dispatch.subr:exp_pkg_get_packages(): log message before and after resolving dependencies.
Diffstat (limited to 'subr/ex_pkg_dispatch.subr')
-rw-r--r--subr/ex_pkg_dispatch.subr17
1 files changed, 10 insertions, 7 deletions
diff --git a/subr/ex_pkg_dispatch.subr b/subr/ex_pkg_dispatch.subr
index 7ea95875..13b2a6d8 100644
--- a/subr/ex_pkg_dispatch.subr
+++ b/subr/ex_pkg_dispatch.subr
@@ -29,8 +29,8 @@ exp_pkg_dispatch_group() {
&& _pkg_depends="$(exp_pkg_expand_packages $(ex_rtl_get_var_unsafe "PKG_$(ex_rtl_toupper "${_pkg_name}")_DEPENDS"))"\
&& exp_pkg_check_depends "${_group_name}" "${_pkg_depends}" "${_pkg_name}" \
&& exp_pkg_dispatch_package "${_dispatch_fn}" "${_group_name}" \
- "${_pkg_name}" "${_restart_at}" "${_stderrout_path}" \
- "${_pipe_path}"; then
+ "${_pkg_name}" "${_restart}" "${_restart_at}" \
+ "${_stderrout_path}" "${_pipe_path}"; then
_pkgs_found_new="${_pkgs_found_new:+${_pkgs_found_new} }${_pkg_name}";
break;
fi;
@@ -39,8 +39,8 @@ exp_pkg_dispatch_group() {
};
exp_pkg_dispatch_package() {
- local _dispatch_fn="${1}" _group_name="${2}" _pkg_name="${3}" _restart_at="${4}" \
- _stderrout_path="${5}" _pipe_path="${6}" _pkg_name_uc="" _rc=0;
+ local _dispatch_fn="${1}" _group_name="${2}" _pkg_name="${3}" _restart="${4}" _restart_at="${5}" \
+ _stderrout_path="${6}" _pipe_path="${7}" _pkg_name_uc="" _rc=0;
_pkg_name_uc="$(ex_rtl_toupper "${_pkg_name}")";
if [ -n "$(ex_rtl_get_var_unsafe PKG_${_pkg_name_uc}_DISABLED)" ]; then
_pkgs_complete="${_pkgs_complete:+${_pkgs_complete} }${_pkg_name}";
@@ -48,7 +48,8 @@ exp_pkg_dispatch_package() {
: $((_pkgs_count+=1)); _rc=1;
"${_dispatch_fn}" disabled_pkg "${_group_name}" "${_pkg_name}" "${_pkgs_count}" "${_pkgs_count_max}";
elif ex_pkg_state_test "${_pkg_name}" finish\
- && [ -z "${_restart_at}" ]; then
+ && [ -z "$(ex_rtl_lsearch "${_restart}" "${_pkg_name}")" ]\
+ && [ "${ARG_RESTART_RECURSIVE}" -ne 2 ]; then
_pkgs_complete="${_pkgs_complete:+${_pkgs_complete} }${_pkg_name}";
_pkg_names="$(ex_rtl_lfilter "${_pkg_names}" "${_pkg_name}")";
: $((_pkgs_count+=1)); _rc=1;
@@ -59,7 +60,7 @@ exp_pkg_dispatch_package() {
"${_dispatch_fn}" start_pkg "${_group_name}" "${_pkg_name}" "${_pkgs_count}" "${_pkgs_count_max}";
(set -o errexit -o noglob; BUILD_IS_PARENT=0;
ex_pkg_env "${_group_name}" "${_pkg_name}" "${_restart_at}";
- ex_pkg_exec "${_group_name}" "${_pkg_name}" "${_restart_at}" \
+ ex_pkg_exec "${_group_name}" "${_pkg_name}" "${_restart_at}" \
"${_dispatch_fn}";) 1>"${_stderrout_path}" 2>&1 3>"${_pipe_path}" &
: $((_njobs+=1));
fi;
@@ -89,8 +90,10 @@ exp_pkg_get_packages() {
_pkg_names="$(ex_rtl_lsearch "${_pkg_names}" "${_restart}")";
fi;
if ! [ -n "${_restart}" ]\
- || [ "${ARG_RESTART_RECURSIVE:-0}" -eq 1 ]; then
+ || [ "${ARG_RESTART_RECURSIVE:-0}" -ge 1 ]; then
+ ex_rtl_log_msg vnfo "Resolving \`${_group_name}' dependencies...";
_pkg_names="$(ex_rtl_uniq $(exp_pkg_expand_packages ${_pkg_names}))";
+ ex_rtl_log_msg vnfo "Resolved \`${_group_name}' dependencies.";
fi;
};