diff options
author | Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de> | 2020-03-11 17:33:31 +0000 |
---|---|---|
committer | Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de> | 2020-03-11 17:33:31 +0000 |
commit | f243bed357feef6e7554767c44a6b6c97b11c3ec (patch) | |
tree | d113196482807409444ec1aa615333603970793d /subr | |
parent | ed7b28de4ac405fd1da51c2a338f655a21ec0e73 (diff) | |
download | midipix_build-f243bed357feef6e7554767c44a6b6c97b11c3ec.tar.bz2 midipix_build-f243bed357feef6e7554767c44a6b6c97b11c3ec.tar.xz |
pkgtool.sh, subr/{build_init,ex_pkg_exec}.subr: rebuild package, dump & exit if package dump is unavailable.
build.sh:buildp_dispatch_fail_pkg(): log --dump-{in,on-abort} messages at `info' level.
Diffstat (limited to 'subr')
-rw-r--r-- | subr/build_init.subr | 15 | ||||
-rw-r--r-- | subr/ex_pkg_exec.subr | 7 |
2 files changed, 17 insertions, 5 deletions
diff --git a/subr/build_init.subr b/subr/build_init.subr index e3bf7b3c..e07facaf 100644 --- a/subr/build_init.subr +++ b/subr/build_init.subr @@ -49,9 +49,9 @@ buildp_init_defaults() { # Command-line arguments : ${ARCH:="nt64"}; : ${BUILD:="debug"}; - ARG_AS_NEEDED=0; ARG_CLEAN_BUILDS=""; ARG_DEBUG_MINIPIX=0; ARG_DUMP_ON_ABORT=0; - ARG_DIST=""; ARG_FETCH_FORCE=0; ARG_PARALLEL=1; ARG_RELAXED=0; ARG_RESTART=""; - ARG_VERBOSE=0; + ARG_AS_NEEDED=0; ARG_CLEAN_BUILDS=""; ARG_DEBUG_MINIPIX=0; ARG_DUMP_IN=""; + ARG_DUMP_ON_ABORT=0; ARG_DIST=""; ARG_FETCH_FORCE=0; ARG_PARALLEL=1; ARG_RELAXED=0; + ARG_RESTART=""; ARG_VERBOSE=0; # Build parameters & state BUILD_HNAME=""; BUILD_IS_PARENT=1; BUILD_GROUPS=""; BUILD_GROUPS_INHIBIT_DEPS=0; @@ -126,6 +126,11 @@ buildp_init_getopts() { while [ "${#}" -gt 0 ]; do case "${1}" in --as-needed) ARG_AS_NEEDED=1; _shiftfl=1; ;; + --dump-in) if [ "${#}" -ge 2 ]; then + ARG_DUMP_IN="${2}"; ARG_DUMP_ON_ABORT=1; _shiftfl=2; + else + _rc=1; _status="Error: missing argument to option --dump-in."; + fi; ;; --dump-on-abort) ARG_DUMP_ON_ABORT=1; _shiftfl=1; ;; --debug-minipx) ARG_DEBUG_MINIPIX=1; _shiftfl=1; ;; @@ -134,7 +139,9 @@ buildp_init_getopts() { done; _shiftfl=1; ;; *) _shiftfl=0; ;; esac; - if [ "${_shiftfl}" -gt 0 ]; then + if [ "${_rc}" -ne 0 ]; then + break; + elif [ "${_shiftfl}" -gt 0 ]; then shift "${_shiftfl}"; continue; elif getopts a:b:C:D:Fhp:Pr:R _opt; then case "${_opt}" in diff --git a/subr/ex_pkg_exec.subr b/subr/ex_pkg_exec.subr index f21bc3d8..fb0cfa02 100644 --- a/subr/ex_pkg_exec.subr +++ b/subr/ex_pkg_exec.subr @@ -101,7 +101,12 @@ ex_pkg_exec() { else set -- ${PKG_BUILD_STEPS}; while [ ${#} -gt 0 ]; do _step="${1}"; _step_next="${2}"; shift; - if [ "${PKG_FORCE:-0}" -eq 0 ]\ + if [ "${ARG_DUMP_IN}" = "${_step}" ]; then + printf "" > "${BUILD_WORKDIR}/${_pkg_name}.dump"; + rtl_filter_vars exp_pkg_exec_filter_vars_fn >> "${BUILD_WORKDIR}/${_pkg_name}.dump"; + export >> "${BUILD_WORKDIR}/${_pkg_name}.dump"; + exit 1; + elif [ "${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 |