[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] reproducible Archlinux: add simple script for manually scheduling packages

Holger Levsen gitlab at salsa.debian.org
Wed Sep 26 13:08:06 BST 2018


Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net


Commits:
d1c149f8 by Holger Levsen at 2018-09-26T12:07:52Z
reproducible Archlinux: add simple script for manually scheduling packages

Signed-off-by: Holger Levsen <holger at layer-acht.org>

- - - - -


1 changed file:

- + bin/reproducible_archlinux_manual_scheduler.sh


Changes:

=====================================
bin/reproducible_archlinux_manual_scheduler.sh
=====================================
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+# Copyright 2018 Holger Levsen <holger at layer-acht.org>
+# released under the GPLv=2
+
+DEBUG=false
+. /srv/jenkins/bin/common-functions.sh
+common_init "$@"
+
+# common code
+. /srv/jenkins/bin/reproducible_common.sh
+
+set -e
+
+if [ "$1" = "" ] || [ "$2" = "" ] ; then
+	echo "Need at least two parameters:"
+	echo "$0 \$RESPOSITORY \$SOURCEPKGNAME1 \$SOURCEPKGNAME2 \$SOURCEPKGNAME3..."
+	exit 1
+elif [ "$1" != "core" ] && [ "$1" != "extra" ] && [ "$1" != "multilib" ] && [ "$1" != "community" ] ; then
+	echo "\$RESPOSITORY needs to be one of core, extra, multilib or community."
+        exit 1
+fi
+
+DATE="$(date -u +'%Y-%m-%d %H:%M' -d '21 days ago')"
+REPOSITORY=$1
+SUITE=archlinux_$REPOSITORY
+ARCH=x86_64
+shift
+PACKAGES="$@"
+SUCCESS=""
+for PKG in $PACKAGES ; do
+	echo "Now trying to reschedule $PKG in $SUITE."
+	PKG_ID=$(query_db "SELECT id FROM sources WHERE name='$PKG' AND suite='$SUITE' AND architecture='$ARCH';")
+	if [ ! -z "${PKG_ID}" ] ; then
+		SCHEDULED=$(query_db "SELECT * FROM schedule WHERE package_id = '${PKG_ID}';")
+		if [ -z "$SCHEDULED" ] ; then
+			query_db "INSERT INTO schedule (package_id, date_scheduled) VALUES ('${PKG_ID}', '$DATE');"
+			SUCCESS="$SUCCESS $PKG"
+		else
+			echo " $PKG (package_id: ${PKG_ID}) already scheduled, not scheduling again."
+		fi
+	else
+		echo " $PKG does not exist in $SUITE, ignoring."
+	fi
+done
+
+if [ ! -z "$SUCCESS" ] ; then
+	MESSAGE="Manually scheduled these packages in $SUITE:$SUCCESS"
+	echo "$MESSAGE"
+	irc_message archlinux-reproducible "$MESSAGE"
+fi
+
+exit 0
+
+# vim: set sw=0 noet :



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/commit/d1c149f8230dd3a6b895ce0cb1e345b856f53432

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/commit/d1c149f8230dd3a6b895ce0cb1e345b856f53432
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20180926/48d0b77f/attachment-0001.html>


More information about the Qa-jenkins-scm mailing list