diff options
author | Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de> | 2020-02-14 13:00:38 +0000 |
---|---|---|
committer | Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de> | 2020-02-14 13:00:38 +0000 |
commit | ebda8bb2b1103bfe79ba7196832f4c0b2b5caffd (patch) | |
tree | 562b7460470dd345137d041694fcbb7f8dac74d4 /subr | |
parent | ae3ff05d44d48ca824347bdbd6b823a9720b1a0c (diff) | |
download | midipix_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')
-rw-r--r-- | subr/build_init.subr | 11 | ||||
-rw-r--r-- | subr/ex_pkg_dispatch.subr | 17 |
2 files changed, 17 insertions, 11 deletions
diff --git a/subr/build_init.subr b/subr/build_init.subr index 53327ace..c204c9b6 100644 --- a/subr/build_init.subr +++ b/subr/build_init.subr @@ -11,15 +11,18 @@ buildp_ast() { }; buildp_init_args() { - _status=""; + local _last_pkg=""; _status=""; if [ "${ARG_AS_NEEDED:-0}" -eq 1 ]\ && [ -e "${PREFIX}/build.gitref" ]\ && [ "$(git rev-parse HEAD)" = "$(cat "${PREFIX}/build.gitref")" ]; then _status="Git repository has not changed since last build and --as-needed was specified."; fi; - if [ -n "${ARG_RESTART}" ]\ - && [ "${ARG_RESTART#\*}" != "${ARG_RESTART}" ]; then - ARG_RESTART="${ARG_RESTART#\*}"; ARG_RESTART_RECURSIVE=1; + if [ -n "${ARG_RESTART}" ]; then + if [ "${ARG_RESTART#\*\*}" != "${ARG_RESTART}" ]; then + ARG_RESTART="${ARG_RESTART#\*\*}"; ARG_RESTART_RECURSIVE=2; + elif [ "${ARG_RESTART#\*}" != "${ARG_RESTART}" ]; then + ARG_RESTART="${ARG_RESTART#\*}"; ARG_RESTART_RECURSIVE=1; + fi; fi; case "${ARG_RESTART}" in ALL) ARG_RESTART_AT=ALL; ;; 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; }; |