diff options
author | Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de> | 2020-02-26 21:54:12 +0000 |
---|---|---|
committer | Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de> | 2020-02-26 21:54:12 +0000 |
commit | c6d6e08feab839a9dc5792071fb803494cc51a69 (patch) | |
tree | 1513c817e4446ac3cf512d6c1f287a10fc1daf2e /subr/ex_pkg_exec.subr | |
parent | 4a5da5254e1207686f492e7ce8759c80466185f3 (diff) | |
download | midipix_build-c6d6e08feab839a9dc5792071fb803494cc51a69.tar.bz2 midipix_build-c6d6e08feab839a9dc5792071fb803494cc51a69.tar.xz |
General cleanup, pt. II.
Diffstat (limited to 'subr/ex_pkg_exec.subr')
-rw-r--r-- | subr/ex_pkg_exec.subr | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/subr/ex_pkg_exec.subr b/subr/ex_pkg_exec.subr index 2d14a018..0a40cfcf 100644 --- a/subr/ex_pkg_exec.subr +++ b/subr/ex_pkg_exec.subr @@ -15,21 +15,21 @@ exp_pkg_exec_pre() { if [ -z "${PKG_URL}" ]\ && [ -z "${PKG_URLS_GIT}" ]\ && [ -z "${PKG_VERSION}" ]\ - && ! ex_rtl_test_cmd "pkg_${_pkg_name}_all"; then - "${_dispatch_fn}" exec_missing "${_group_name}" "${_pkg_name}"; + && ! rtl_test_cmd "pkg_${_pkg_name}_all"; then + "${_dispatch_fn}" missing_pkg "${_group_name}" "${_pkg_name}"; return 1; elif ! ex_pkg_state_test "${_pkg_name}" "start" "${_restart_at}"; then if [ "${PKG_NO_CLEAN_BASE_DIR:-0}" -eq 0 ]\ - && ! ex_rtl_fileop rm "${PKG_BASE_DIR}" "${PKG_BUILD_DIR}" "${PKG_DESTDIR}"\ - || ! ex_rtl_fileop mkdir "${PKG_BASE_DIR}"; then + && ! rtl_fileop rm "${PKG_BASE_DIR}" "${PKG_BUILD_DIR}" "${PKG_DESTDIR}"\ + || ! rtl_fileop mkdir "${PKG_BASE_DIR}"; then return "${?}"; fi; - if ! ex_rtl_fileop mkdir "${PKG_BUILD_DIR}" "${PKG_DESTDIR}"\ + if ! rtl_fileop mkdir "${PKG_BUILD_DIR}" "${PKG_DESTDIR}"\ || ! ex_pkg_state_set "${_pkg_name}" "start"; then return "${?}"; fi; fi; - ex_rtl_fileop cd "${PKG_BUILD_DIR}"; + rtl_fileop cd "${PKG_BUILD_DIR}"; }; # @@ -44,7 +44,7 @@ exp_pkg_exec_pre() { exp_pkg_exec_step() { local _group_name="${1}" _pkg_name="${2}" _restart_at="${3}" _step="${4}" \ _fn_name="" _pkg_step_fn="" _rc=0; - if ex_rtl_test_cmd "pkg_${_pkg_name}_${_step}"; then + if rtl_test_cmd "pkg_${_pkg_name}_${_step}"; then _pkg_step_fn="pkg_${_pkg_name}_${_step}"; else _pkg_step_fn="pkg_${_step}"; @@ -53,7 +53,7 @@ exp_pkg_exec_step() { "pkg_${_pkg_name}_${_step}_pre" \ "${_pkg_step_fn}" \ "pkg_${_pkg_name}_${_step}_post"; do - if ex_rtl_test_cmd "${_fn_name}"\ + if rtl_test_cmd "${_fn_name}"\ && ! "${_fn_name}" "${_group_name}" "${_pkg_name}" "${_restart_at}"; then _rc=1; break; fi; @@ -80,24 +80,23 @@ ex_pkg_exec() { pkill -U "${$}"; \ fi;" EXIT HUP INT TERM USR1 USR2; if exp_pkg_exec_pre "${_group_name}" "${_pkg_name}" "${_restart_at}"\ - && "${_dispatch_fn}" exec_start "${_group_name}" "${_pkg_name}"; then - if ex_rtl_test_cmd "pkg_${_pkg_name}_all"; then + && "${_dispatch_fn}" start_pkg_child "${_group_name}" "${_pkg_name}"; then + if rtl_test_cmd "pkg_${_pkg_name}_all"; then "pkg_${_pkg_name}_all" "${_restart_at}"; else set -- ${PKG_BUILD_STEPS}; while [ ${#} -gt 0 ]; do _step="${1}"; _step_next="${2}"; shift; - if ex_pkg_state_test "${_pkg_name}" "${_step}" "${_restart_at}"; then + if [ "${PKG_FORCE:-0}" -eq 0 ]\ + && ex_pkg_state_test "${_pkg_name}" "${_step}" "${_restart_at}" ; then continue; elif ! exp_pkg_exec_step "${_group_name}" "${_pkg_name}" "${_restart_at}" "${_step}"; then _rc=1; break; else echo "step ${_group_name} ${_pkg_name} ${_step}" >&3; - "${_dispatch_fn}" exec_step "${_group_name}" "${_pkg_name}" "${_step}"; ex_pkg_state_set "${_pkg_name}" "${_step}" "${_step_next:+-${_step_next}}"; fi; done; fi; - "${_dispatch_fn}" exec_finish "${_group_name}" "${_pkg_name}"; ex_pkg_state_set "${_pkg_name}" finish; fi; return "${_rc}"; |