Commit 34e71830 authored by Holger Levsen's avatar Holger Levsen

reproducible Arch Linux: fixup detection of bad builds

Signed-off-by: Holger Levsen's avatarHolger Levsen <holger@layer-acht.org>
parent 5042bb23
......@@ -81,15 +81,15 @@ choose_package() {
SRCPACKAGE=$(echo $RESULT|cut -d "|" -f3)
VERSION=$(echo $RESULT|cut -d "|" -f4)
# remove previous build attempts which didnt finish correctly:
JOB_PREFIX="${JOB_NAME#reproducible_builder_}/"
JOB_SHORTNAME="${JOB_NAME#reproducible_builder_}"
BAD_BUILDS=$(mktemp --tmpdir=$TMPDIR)
query_db "SELECT package_id, date_build_started, job FROM schedule WHERE job LIKE '${JOB_PREFIX}%'" > $BAD_BUILDS
query_db "SELECT package_id, date_build_started, job FROM schedule WHERE job LIKE '%${JOB_SHORTNAME}'" > $BAD_BUILDS
if [ -s "$BAD_BUILDS" ] ; then
local STALELOG=/var/log/jenkins/reproducible-archlinux-stale-builds.log
# reproducible-archlinux-stale-builds.log is mailed once a day by reproducible_maintenance.sh
echo -n "$(date -u) - stale builds found, cleaning db from these: " | tee -a $STALELOG
cat $BAD_BUILDS | tee -a $STALELOG
query_db "UPDATE schedule SET date_build_started = NULL, job = NULL WHERE job LIKE '${JOB_PREFIX}%'"
query_db "UPDATE schedule SET date_build_started = NULL, job = NULL WHERE job LIKE '%${JOB_SHORTNAME}'"
fi
rm -f $BAD_BUILDS
# mark build attempt, first test if none else marked a build attempt recently
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment