Commit ac9b8982 authored by Holger Levsen's avatar Holger Levsen

reproducible Archlinux: remove removed packages from db

Signed-off-by: Holger Levsen's avatarHolger Levsen <holger@layer-acht.org>
parent 53666fe8
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment