[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] reproducible Archlinux: remove removed packages from db
Holger Levsen
gitlab at salsa.debian.org
Tue Sep 25 19:29:08 BST 2018
Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net
Commits:
ac9b8982 by Holger Levsen at 2018-09-25T18:28:36Z
reproducible Archlinux: remove removed packages from db
Signed-off-by: Holger Levsen <holger at layer-acht.org>
- - - - -
2 changed files:
- TODO
- bin/reproducible_archlinux_scheduler.sh
Changes:
=====================================
TODO
=====================================
@@ -320,7 +320,7 @@ See link:https://jenkins.debian.net/userContent/about.html["about jenkins.debian
* use db - see https://tests.reproducible-builds.org/reproducibledb.html
** extend scheduler.sh:
*** comparing versions is probably needed: if its not empty it must be higher (due to repo constraints), but it can be even higher than in the repo, because we build trunk
-*** also delete unknown packages from db: sources and schedule and results as well
+*** dont delete packages which are building?
*** check/make sure that packages which are newer in trunk than repo are only scheduled once
** make _archlinux_build.sh
*** refactor and reuse unregister_build from _build.sh
=====================================
bin/reproducible_archlinux_scheduler.sh
=====================================
@@ -52,9 +52,7 @@ update_archlinux_repositories() {
#
# remove packages which are gone (only when run between 21:00 and 23:59)
#
- #if [ $(date +'%H') -gt 21 ] ; then
- #FIXME: the next lines actually disables this code block...
- if [ $(date +'%H') -gt 25 ] ; then
+ if [ $(date +'%H') -gt 21 ] ; then
REMOVED=0
REMOVE_LIST=""
for REPO in $ARCHLINUX_REPOS ; do
@@ -65,16 +63,18 @@ update_archlinux_repositories() {
let REMOVED=$REMOVED+1
REMOVE_LIST="$REMOVE_LIST $REPO/$PKG"
rm -r --one-file-system $BASE/archlinux/$REPO/$PKG
- echo "$REPO/$PKG removed as it's gone from the Archlinux repositories."
- # FIXME: we actually need to drop them from the db now...
- # from results
- # from scheduled
- # from sources
+ echo "$(date -u) - $REPO/$PKG removed as it's gone from the Archlinux repositories."
+ SUITE="archlinux_$repo"
+ PKG_ID=$(query_db "SELECT id FROM sources WHERE name='$PKG' AND suite='$SUITE' AND architecture='$ARCH';")
+ query_db "DELETE FROM results WHERE package_id='${PKG_ID}';"
+ query_db "DELETE FROM schedule WHERE package_id='${PKG_ID}';"
+ query_db "DELETE FROM sources WHERE id='${PKG_ID}';"
+ echo "$(date -u) - $SUITE $PKG removed from database."
fi
done
done
MESSAGE="deleted $REMOVED packages: $REMOVE_LIST"
- echo "$(date -u ) - $MESSAGE"
+ echo -n "$(date -u ) - "
if [ $REMOVED -ne 0 ] ; then
irc_message archlinux-reproducible "$MESSAGE"
fi
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/commit/ac9b89825a66657ca9c3e8c48e597646e9fcb151
--
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/commit/ac9b89825a66657ca9c3e8c48e597646e9fcb151
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/20180925/ea662189/attachment-0001.html>
More information about the Qa-jenkins-scm
mailing list