From 235ec73ab1126ca9afcebb4ada6faf20e2c73911 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Sun, 19 Oct 2014 17:02:47 +0200 Subject: reproducible: inform about aborted or otherwise hanging builds --- bin/reproducible_housekeeping.sh | 28 ++++++++++++++++++++++++++++ logparse/reproducible.rules | 2 ++ 2 files changed, 30 insertions(+) diff --git a/bin/reproducible_housekeeping.sh b/bin/reproducible_housekeeping.sh index 99efc280..8abcb6d6 100755 --- a/bin/reproducible_housekeeping.sh +++ b/bin/reproducible_housekeeping.sh @@ -11,6 +11,7 @@ common_init "$@" # common set +x +set -e REP_RESULTS=/srv/reproducible-results # prepare backup @@ -71,3 +72,30 @@ if [ -s $RESULT ] ; then fi rm $HAYSTACK $RESULT +# find packages which build didnt end correctly +QUERY=" + SELECT * FROM sources_scheduled + WHERE date_scheduled != '' + AND date_build_started != '' + AND date_build_started < datetime('now', '-1 day') + ORDER BY date_scheduled + " +PACKAGES=$(mktemp) +sqlite3 -init $INIT ${PACKAGES_DB} "$QUERY" > $PACKAGES +if [ -s $PACKAGES ] ; then + echo + echo "Warning: packages found where the build was started more than 24h ago:" + echo "name|date_scheduled|date_build_started" + echo + cat $PACKAGES + echo + echo "To fix:" + echo + for PKG in $(cat $PACKAGES | cut -d "|" -f1) ; do + echo " sqlite3 ${PACKAGES_DB} \"DELETE FROM sources_scheduled WHERE name = '$PKG';\"" + done + echo +fi +rm $PACKAGES + +exit 0 diff --git a/logparse/reproducible.rules b/logparse/reproducible.rules index 742a6c33..581e029a 100644 --- a/logparse/reproducible.rules +++ b/logparse/reproducible.rules @@ -7,3 +7,5 @@ warning /Warning: .+ contains invalid yaml, please fix./ warning /Warning: old temp directories found in .+/ warning /Warning: lock .+ still exists, exiting./ warning /Warning: processes found which should not be there/ +warning /Warning: packages found where the build was started more than 24h ago/ + -- cgit v1.2.3-70-g09d2