From 4dc7b6ee2523ae1bd7c14f0bc7862325c98ef13c Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Tue, 24 Feb 2015 08:28:34 +0100 Subject: reproducible: schedule_on_demand.sh: update to a new database schema supporting multiple suites + move the informative echo at the end --- bin/reproducible_schedule_on_demand.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'bin/reproducible_schedule_on_demand.sh') diff --git a/bin/reproducible_schedule_on_demand.sh b/bin/reproducible_schedule_on_demand.sh index 5b4f3ea0..d85ee266 100755 --- a/bin/reproducible_schedule_on_demand.sh +++ b/bin/reproducible_schedule_on_demand.sh @@ -11,26 +11,22 @@ common_init "$@" . /srv/jenkins/bin/reproducible_common.sh schedule_packages() { - # these packages are manually scheduled, so should have high prio + # these packages are manually scheduled, so should have high priority, # so schedule them in the past, so they are picked earlier :) DATE="2014-10-01 00:23" TMPFILE=$(mktemp) for PKG in $PACKAGES ; do - echo "REPLACE INTO sources_scheduled VALUES ('$PKG','$DATE','');" >> $TMPFILE + echo "REPLACE INTO schedule (package_id, date_scheduled, date_build_started) VALUES ('$PKG', '$DATE', '');" >> $TMPFILE done cat $TMPFILE | sqlite3 -init $INIT ${PACKAGES_DB} rm $TMPFILE - echo "=============================================================================" - echo "The following $TOTAL source packages have been (re-)scheduled: $PACKAGES" - echo "=============================================================================" - echo } check_candidates() { PACKAGES="" TOTAL=0 for PKG in $CANDIDATES ; do - RESULT=$(sqlite3 -init $INIT ${PACKAGES_DB} "SELECT name from sources WHERE name = '$PKG';") + RESULT=$(sqlite3 -init $INIT ${PACKAGES_DB} "SELECT id from sources WHERE name='$PKG' AND suite='$SUITE';") if [ ! -z "$RESULT" ] ; then PACKAGES="$PACKAGES $RESULT" let "TOTAL+=1" @@ -54,6 +50,8 @@ check_candidates() { # main # set +x +SUITE="$1" +shift CANDIDATES="$@" check_candidates if [ ${#PACKAGES} -gt 256 ] ; then @@ -72,4 +70,7 @@ schedule_packages echo echo "$MESSAGE" kgb-client --conf /srv/jenkins/kgb/debian-reproducible.conf --relay-msg "$MESSAGE" +echo "=============================================================================" +echo "The following $TOTAL source $PACKAGES_TXT $ACTION: $PACKAGES" +echo "=============================================================================" echo -- cgit v1.2.3-54-g00ecf