summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_common.sh
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-06-13 18:06:55 +0200
committerHolger Levsen <holger@layer-acht.org>2015-06-14 22:36:07 +0200
commit860f29ff449b15a082407c80075e51be1e86c1a7 (patch)
tree53dca729712239cf18b73a449e20718438b446a0 /bin/reproducible_common.sh
parentc83b788568167ed7f197d8613e93817e4f98ebaf (diff)
downloadjenkins.debian.net-860f29ff449b15a082407c80075e51be1e86c1a7.tar.xz
reproducible: reduce code duplication by teaching sh's schedule_packages() to call reproducible_schedule_on_demand.py and fix various scripts
Diffstat (limited to 'bin/reproducible_common.sh')
-rwxr-xr-xbin/reproducible_common.sh39
1 files changed, 1 insertions, 38 deletions
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() {