summaryrefslogtreecommitdiffhomepage
path: root/pkgtool.sh
diff options
context:
space:
mode:
authorLucio Andrés Illanes Albornoz <lucio@lucioillanes.de>2020-03-11 17:33:31 +0000
committerLucio Andrés Illanes Albornoz <lucio@lucioillanes.de>2020-03-11 17:33:31 +0000
commitf243bed357feef6e7554767c44a6b6c97b11c3ec (patch)
treed113196482807409444ec1aa615333603970793d /pkgtool.sh
parented7b28de4ac405fd1da51c2a338f655a21ec0e73 (diff)
downloadmidipix_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 'pkgtool.sh')
-rwxr-xr-xpkgtool.sh29
1 files changed, 25 insertions, 4 deletions
diff --git a/pkgtool.sh b/pkgtool.sh
index ec17cc0e..2241f4af 100755
--- a/pkgtool.sh
+++ b/pkgtool.sh
@@ -56,15 +56,36 @@ pkgtoolp_update_diff() {
fi;
};
+pkgtoolp_env() {
+ local _rc=0; _status="";
+ if [ ! -e "${BUILD_WORKDIR}/${PKG_NAME}.dump" ]; then
+ rtl_log_msg fail "Warning: failed to locate environment dump for package \`${PKG_NAME}' in \`${BUILD_WORKDIR}'.";
+ rtl_log_msg info "Rebuilding package \`${PKG_NAME}' w/ --dump-in build...";
+ (export ARCH BUILD \
+ BUILD_DLCACHEDIR BUILD_WORKDIR \
+ PREFIX PREFIX_CROSS PREFIX_MINGW32 PREFIX_MINIPIX \
+ PREFIX_NATIVE PREFIX_ROOT PREFIX_RPM;
+ ./build.sh -a "${ARCH}" -b "${BUILD}" --dump-in build -P -r "${PKG_NAME}" -v);
+ if [ ! -e "${BUILD_WORKDIR}/${PKG_NAME}.dump" ]; then
+ _rc=1; _status="Error: failed to locate environment dump for package \`${PKG_NAME}' in \`${BUILD_WORKDIR}'.";
+ fi;
+ else
+ _rc=0;
+ fi;
+ if [ "${_rc:-0}" -eq 0 ]\
+ && ! . "${BUILD_WORKDIR}/${PKG_NAME}.dump"; then
+ _rc=1; _status="Error: failed to source environment dump for package \`${PKG_NAME}' from \`${BUILD_WORKDIR}'.";
+ fi; return "${_rc}";
+};
+
pkgtool() {
+ local _status="";
if ! cd "$(dirname "${0}")"\
|| ! . ./subr/pkgtool_init.subr\
|| ! pkgtool_init "${@}"; then
printf "Error: failed to setup environment.\n"; exit 1;
- elif [ ! -e "${BUILD_WORKDIR}/${PKG_NAME}.dump" ]; then
- rtl_log_msg failexit "Error: failed to locate environment dump for package \`${PKG_NAME}' in \`${BUILD_WORKDIR}'.";
- elif ! . "${BUILD_WORKDIR}/${PKG_NAME}.dump"; then
- rtl_log_msg failexit "Error: failed to source environment dump for package \`${PKG_NAME}' from \`${BUILD_WORKDIR}'.";
+ elif ! pkgtoolp_env; then
+ rtl_log_msg failexit "${_status}";
elif ! rtl_fileop cd "${PKG_BUILD_DIR}"; then
rtl_log_msg failexit "Error: failed to change working directory to \`${PKG_BUILD_DIR}'.";
elif [ -n "${ARG_RESTART_AT}" ]; then