From 860f29ff449b15a082407c80075e51be1e86c1a7 Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Sat, 13 Jun 2015 18:06:55 +0200 Subject: reproducible: reduce code duplication by teaching sh's schedule_packages() to call reproducible_schedule_on_demand.py and fix various scripts --- bin/reproducible_common.sh | 39 +-------------------------------------- 1 file changed, 1 insertion(+), 38 deletions(-) (limited to 'bin/reproducible_common.sh') diff --git a/bin/reproducible_common.sh b/bin/reproducible_common.sh index 9cf4f514..1a4b81af 100755 --- a/bin/reproducible_common.sh +++ b/bin/reproducible_common.sh @@ -92,44 +92,7 @@ META_PKGSET[26]="maint_debian-boot" META_PKGSET[27]="maint_debian-ocaml" schedule_packages() { - # these packages are manually scheduled, so should have high priority, - # so schedule them in the past, so they are picked earlier :) - # the current date is subtracted twice, so that packages scheduled later get higher will be picked sooner - DAYS=$(echo "$(date +'%j')*2"|bc) - HOURS=$(echo "$(date +'%H')*2"|bc) - MINS=$(date +'%M') # schedule on the full hour so we can recognize them easily - DATE=$(date +'%Y-%m-%d %H:%M' -d "$DAYS day ago - $HOURS hours - $MINS minutes") - TMPFILE=$(mktemp --tmpdir=$TEMPDIR) - for PKG_ID in $@ ; do - echo "REPLACE INTO schedule (package_id, date_scheduled, date_build_started, save_artifacts, notify) VALUES ('$PKG_ID', '$DATE', '', '$ARTIFACTS', '$NOTIFY');" >> $TMPFILE - done - cat $TMPFILE | sqlite3 -init $INIT ${PACKAGES_DB} - rm $TMPFILE - cd /srv/jenkins/bin - python3 -c "from reproducible_html_indexes import generate_schedule; generate_schedule()" -} - -check_candidates() { - PACKAGE_IDS="" - PACKAGES_NAMES="" - TOTAL=0 - for PKG in $CANDIDATES ; do - RESULT=$(sqlite3 -init $INIT ${PACKAGES_DB} "SELECT id, name from sources WHERE name='$PKG' AND suite='$SUITE';") - if [ ! -z "$RESULT" ] ; then - PACKAGE_IDS="$PACKAGE_IDS $(echo $RESULT|cut -d '|' -f 1)" - PACKAGES_NAMES="$PACKAGES_NAMES $(echo $RESULT|cut -d '|' -f 2)" - let "TOTAL+=1" - fi - done - PACKAGE_IDS=$(echo $PACKAGE_IDS) - case $TOTAL in - 1) - PACKAGES_TXT="package" - ;; - *) - PACKAGES_TXT="packages" - ;; - esac + LC_USER="$REQUESTER" LOCAL_CALL="true" /srv/jenkins/bin/reproducible_remote_scheduler.py --no-notify --suite "$UITE" $@ } write_page() { -- cgit v1.2.3-54-g00ecf