Commit fa84aa8c authored by Holger Levsen's avatar Holger Levsen

reproducible Archlinux: only remove from database if pkg exists in db

Signed-off-by: Holger Levsen's avatarHolger Levsen <holger@layer-acht.org>
parent 399c1f90
......@@ -324,6 +324,7 @@ See link:https://jenkins.debian.net/userContent/about.html["about jenkins.debian
** html:
*** leave all pkg.html files, delete them (much) later, then check all pkg.* files are gone
*** recreate them newly as index.html
**** link to https://www.archlinux.org/packages/$repo/x86_64/$pkgname/
**** provide links to debian pages if same package name exist
*** create new job to recreate all pkg pages
*** create json
......
......@@ -65,10 +65,14 @@ update_archlinux_repositories() {
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."
if [ -n "${PKG_ID}" ] ; then
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."
else
echo "$(date -u) - $SUITE $PKG not found in database."
fi
fi
done
done
......
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