summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_schedule_on_demand.sh
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-02-24 08:28:34 +0100
committerHolger Levsen <holger@layer-acht.org>2015-02-26 17:13:54 +0100
commit4dc7b6ee2523ae1bd7c14f0bc7862325c98ef13c (patch)
treebfe0d7260a3afb477996c4c3a8e79c41e5f72904 /bin/reproducible_schedule_on_demand.sh
parent65446e9be4491624368111b82f3057a0e29a7569 (diff)
downloadjenkins.debian.net-4dc7b6ee2523ae1bd7c14f0bc7862325c98ef13c.tar.xz
reproducible: schedule_on_demand.sh: update to a new database schema supporting multiple suites + move the informative echo at the end
Diffstat (limited to 'bin/reproducible_schedule_on_demand.sh')
-rwxr-xr-xbin/reproducible_schedule_on_demand.sh15
1 files changed, 8 insertions, 7 deletions
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