From ceeb88d755d8fd3445fa27685b9171d30b17c2c4 Mon Sep 17 00:00:00 2001 From: Lucio Andrés Illanes Albornoz (arab, vxp) Date: Jun 01 2017 11:43:59 +0000 Subject: build.sh, subr/pre_build_files.subr: log list of failed build scripts when using relaxed mode (-R). --- diff --git a/build.sh b/build.sh index 1a86b63..d7ee156 100755 --- a/build.sh +++ b/build.sh @@ -117,7 +117,12 @@ for BUILD_TARGET_LC in $(subst_tgts invariants ${BUILD_TARGETS_META:-world}); do : $((BUILD_NFINI+=1)); continue; ;; *) log_msg fail "Build failed in \`${PKG_NAME}' (last return code ${BUILD_SCRIPT_RC}.)."; : $((BUILD_NFAIL+=1)); - [ ${ARG_RELAXED:-0} -eq 0 ] && break || continue; ;; + if [ ${ARG_RELAXED:-0} -eq 1 ]; then + BUILD_PKGS_FAILED="${BUILD_PKGS_FAILED:+${BUILD_PKGS_FAILED} }${PKG_NAME}"; + continue; + else + break; + fi; esac; done; if [ "${BUILD_SCRIPT_RC:-0}" -ne 0 ]; then @@ -130,6 +135,10 @@ fi; post_build_files; log_msg info "${BUILD_NFINI} finished, ${BUILD_NSKIP} skipped, and ${BUILD_NFAIL} failed builds in ${BUILD_NBUILT} build script(s)."; log_msg info "Build time: ${BUILD_TIMES_HOURS} hour(s), ${BUILD_TIMES_MINUTES} minute(s), and ${BUILD_TIMES_SECS} second(s)."; +if [ ${ARG_RELAXED:-0} -eq 1 ]\ +&& [ -n "${BUILD_PKGS_FAILED}" ]; then + log_msg info "Build script failure(s) in: ${BUILD_PKGS_FAILED}."; +fi; exit "${BUILD_SCRIPT_RC}")} 2>&1 | tee "${BUILD_LOG_FNAME}" & TEE_PID="${!}"; trap "rm -f ${BUILD_STATUS_IN_PROGRESS_FNAME}; \ log_msg fail \"Build aborted.\"; \ diff --git a/subr/pre_build_files.subr b/subr/pre_build_files.subr index 700ea74..3fbcf0c 100644 --- a/subr/pre_build_files.subr +++ b/subr/pre_build_files.subr @@ -14,6 +14,7 @@ pre_build_files() { BUILD_DATE_START="$(date %Y-%m-%d-%H-%M-%S)"; BUILD_NFINI=${BUILD_NSKIP:=${BUILD_NFAIL:=${BUILD_NBUILT:=0}}}; BUILD_TIMES_SECS=$(command date +%s); + BUILD_PKGS_FAILED=""; }; # vim:filetype=sh