From 9ce15956105552943ac0fbfa2f020a1b635a0830 Mon Sep 17 00:00:00 2001 From: Andrew Gaffney Date: Mon, 2 Nov 2009 13:31:26 +0000 Subject: [PATCH] Detect build failure in one of the build sets and act accordingly svn path=/trunk/; revision=712 --- tools/ChangeLog | 3 +++ tools/catalyst-auto | 19 ++++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/tools/ChangeLog b/tools/ChangeLog index 4af59d4c..ce82ddf7 100644 --- a/tools/ChangeLog +++ b/tools/ChangeLog @@ -2,6 +2,9 @@ # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 # $Id$ + 02 Nov 2009; Andrew Gaffney catalyst-auto: + Detect build failure in one of the build sets and act accordingly + 01 Jul 2009; Andrew Gaffney catalyst-auto-hppa.conf: Switch hppa config to use build sets diff --git a/tools/catalyst-auto b/tools/catalyst-auto index 9f0b9e21..6139ef15 100755 --- a/tools/catalyst-auto +++ b/tools/catalyst-auto @@ -197,6 +197,8 @@ if ! run_cmd "catalyst -c ${CATALYST_CONFIG} -s ${DATESTAMP}" "${TMPDIR}/log/sna exit 1 fi +build_failure=0 + for a in "" ${SETS}; do if [ -z "${a}" ]; then specs_var="SPECS" @@ -210,6 +212,7 @@ for a in "" ${SETS}; do LOGFILE="${TMPDIR}/log/$(echo "${i}" | sed -e 's:/:_:' -e 's:\.spec$::').log" run_cmd "catalyst -a -p -c ${CATALYST_CONFIG} -f ${i}" ${LOGFILE} if [ $? != 0 ]; then + build_failure=1 send_email "Catalyst fatal build error - ${i}" "" "${LOGFILE}" continue 2 fi @@ -219,6 +222,7 @@ for a in "" ${SETS}; do LOGFILE="${TMPDIR}/log/$(echo "${i}" | sed -e 's:/:_:' -e 's:\.spec$::').log" run_cmd "catalyst -a -p -c ${CATALYST_CONFIG} -f ${i}" ${LOGFILE} if [ $? != 0 ]; then + build_failure=1 send_email "Catalyst non-fatal build error - ${i}" "" "${LOGFILE}" break fi @@ -236,11 +240,16 @@ if ! run_cmd "post_build" "${TMPDIR}/log/post_build.log"; then exit 1 fi -send_email "Catalyst build success" "Build process complete." +if [ ${build_failure} = 0 ]; then + send_email "Catalyst build success" "Build process complete." -if [ "${keep_tmpdir}" = 0 ]; then - if ! rm -rf "${TMPDIR}"; then - echo "Could not remove tmpdir ${TMPDIR}!" - exit 1 + if [ "${keep_tmpdir}" = 0 ]; then + if ! rm -rf "${TMPDIR}"; then + echo "Could not remove tmpdir ${TMPDIR}!" + exit 1 + fi fi + +else + send_email "Catalyst build complete, but with errors" "Build process has completed, but there were errors. Please consult previous emails to determine the problem." fi