summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_common.sh
diff options
context:
space:
mode:
authorValerie R Young <spectranaut@riseup.net>2016-09-15 15:32:44 -0400
committerHolger Levsen <holger@layer-acht.org>2016-10-17 11:22:18 +0200
commitaf23288244969b39b25e91a073b46f44e606d73e (patch)
tree052bbe84613e812dcfa5fac410f44503314c06a5 /bin/reproducible_common.sh
parent078490603dea0a356c79fd448c5d5a861b218992 (diff)
downloadjenkins.debian.net-af23288244969b39b25e91a073b46f44e606d73e.tar.xz
reproducible debian: add and use query_db bash function
Signed-off-by: Mattia Rizzolo <mattia@debian.org> Signed-off-by: Holger Levsen <holger@layer-acht.org>
Diffstat (limited to 'bin/reproducible_common.sh')
-rwxr-xr-xbin/reproducible_common.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/reproducible_common.sh b/bin/reproducible_common.sh
index f65dcf03..1aeb3644 100755
--- a/bin/reproducible_common.sh
+++ b/bin/reproducible_common.sh
@@ -34,6 +34,11 @@ elif [ ! -f ${PACKAGES_DB} ] && [ "$HOSTNAME" = "$MAINNODE" ] ; then
EOF
fi
+# query reproducible database
+query_db() {
+ sqlite3 -init ${INIT} ${PACKAGES_DB} "$@"
+}
+
# common variables
REPRODUCIBLE_URL=https://tests.reproducible-builds.org
DEBIAN_URL=https://tests.reproducible-builds.org/debian
@@ -273,7 +278,7 @@ write_page_header() {
write_page " <a href=\"$JENKINS_URL/userContent/about.html#_reproducible_builds_jobs\">jenkins.debian.net</a>."
write_page " Thanks to <a href=\"https://www.profitbricks.co.uk\">Profitbricks</a> for donating the virtual machines this is running on!"
write_page "</ul>"
- LATEST=$(sqlite3 -init $INIT ${PACKAGES_DB} "SELECT s.name FROM results AS r JOIN sources AS s ON r.package_id = s.id WHERE r.status IN ('unreproducible') AND s.suite = 'unstable' AND s.architecture = 'amd64' AND s.id NOT IN (SELECT package_id FROM notes) ORDER BY build_date DESC LIMIT 23"|sort -R|head -1)
+ LATEST=$(query_db "SELECT s.name FROM results AS r JOIN sources AS s ON r.package_id = s.id WHERE r.status IN ('unreproducible') AND s.suite = 'unstable' AND s.architecture = 'amd64' AND s.id NOT IN (SELECT package_id FROM notes) ORDER BY build_date DESC LIMIT 23"|sort -R|head -1)
write_page "<form action=\"$REPRODUCIBLE_URL/redirect\" method=\"GET\">$REPRODUCIBLE_URL/"
write_page "<input type=\"text\" name=\"SrcPkg\" placeholder=\"Type my friend..\" value=\"$LATEST\" />"
write_page "<input type=\"submit\" value=\"submit source package name\" />"