From f3d91fdeddf34b2ec9196b6fa31c2b11defa2760 Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Tue, 11 Aug 2015 12:52:04 +0000 Subject: reproducible: maintenance: also consider architecture while grepping for failed build to reschedule --- bin/reproducible_common.sh | 1 + bin/reproducible_maintenance.sh | 22 +++++++++++++--------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/bin/reproducible_common.sh b/bin/reproducible_common.sh index 933c3e44..64854c4f 100755 --- a/bin/reproducible_common.sh +++ b/bin/reproducible_common.sh @@ -111,6 +111,7 @@ schedule_packages() { --message "$REASON" \ --no-notify \ --suite "$SUITE" \ + --architecture "$ARCH" \ $@ } diff --git a/bin/reproducible_maintenance.sh b/bin/reproducible_maintenance.sh index 8ccf4459..dd935b3e 100755 --- a/bin/reproducible_maintenance.sh +++ b/bin/reproducible_maintenance.sh @@ -1,6 +1,7 @@ #!/bin/bash # Copyright 2014-2015 Holger Levsen +# © 2015 Mattia Rizzolo # released under the GPLv=2 DEBUG=false @@ -82,17 +83,20 @@ if [ "$HOSTNAME" = "jenkins" ] ; then echo "$FAILED_BUILDS" echo echo "Rescheduling packages: " + REQUESTER="jenkins maintenance job" + REASON="maintenance reschedule: reschedule builds which failed due to network errors" for SUITE in $(echo $FAILED_BUILDS | sed "s# #\n#g" | cut -d "/" -f8 | sort -u) ; do - REQUESTER="jenkins maintenance job" - REASON="maintenance reschedule: reschedule builds which failed due to network errors" - CANDIDATES=$(for PKG in $(echo $FAILED_BUILDS | sed "s# #\n#g" | grep "/$SUITE/" | cut -d "/" -f10 | cut -d "_" -f1) ; do echo "$PKG" ; done) - # double check those builds actually failed - TO_SCHEDULE="" - for pkg in $CANDIDATES ; do - QUERY="SELECT s.name FROM sources AS s JOIN results AS r ON r.package_id=s.id WHERE s.suite='$SUITE' AND (r.status='FTBFS' OR r.status='depwait') AND s.name='$pkg'" - TO_SCHEDULE=${TO_SCHEDULE:+"$TO_SCHEDULE "}$(sqlite3 -init $INIT $PACKAGES_DB "$QUERY") + for ARCH in $(echo $FAILED_BUILDS | sed "s# #\n#g" | cut -d "/" -f9 | sort -u) ; do + CANDIDATES=$(for PKG in $(echo $FAILED_BUILDS | sed "s# #\n#g" | grep "/$SUITE/$ARCH/" | cut -d "/" -f10 | cut -d "_" -f1) ; do echo "$PKG" ; done) + # double check those builds actually failed + TO_SCHEDULE="" + for pkg in $CANDIDATES ; do + QUERY="SELECT s.name FROM sources AS s JOIN results AS r ON r.package_id=s.id + WHERE s.suite='$SUITE' AND s.architecture='$ARCH' AND (r.status='FTBFS' OR r.status='depwait') AND s.name='$pkg'" + TO_SCHEDULE=${TO_SCHEDULE:+"$TO_SCHEDULE "}$(sqlite3 -init $INIT $PACKAGES_DB "$QUERY") + done + schedule_packages $TO_SCHEDULE done - schedule_packages $TO_SCHEDULE done DIRTY=true fi -- cgit v1.2.3-70-g09d2