summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2014-11-18 01:52:34 +0100
committerHolger Levsen <holger@layer-acht.org>2014-11-18 01:52:34 +0100
commit4ad042a29d9146189adfe62eeaa6c930e4764d4a (patch)
treead3dae011fd0f92e122c4ab10f9735cce1446f4c /bin
parent2c802c7ec958e9ee92ba25427df96370325be799 (diff)
downloadjenkins.debian.net-4ad042a29d9146189adfe62eeaa6c930e4764d4a.tar.xz
reproducible: remove removed packages from db
Diffstat (limited to 'bin')
-rwxr-xr-xbin/reproducible_maintainance.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/reproducible_maintainance.sh b/bin/reproducible_maintainance.sh
index f7682245..083d269e 100755
--- a/bin/reproducible_maintainance.sh
+++ b/bin/reproducible_maintainance.sh
@@ -101,6 +101,23 @@ if grep -q '|' $PACKAGES ; then
fi
rm $PACKAGES
+# find packages which have been removed from sid
+QUERY="SELECT source_packages.name FROM source_packages
+ WHERE source_packages.name NOT IN
+ (SELECT sources.name FROM sources)
+ LIMIT 25"
+PACKAGES=$(sqlite3 -init $INIT ${PACKAGES_DB} "$QUERY")
+if [ -z "$PACKAGES" ] ; then
+ echo
+ echo "Removing these removed packages from database:"
+ echo $PACKAGES
+ QUERY="DELETE FROM source_packages
+ WHERE source_packages.name NOT IN
+ (SELECT sources.name FROM sources)
+ LIMIT 25"
+ sqlite3 -init $INIT ${PACKAGES_DB} "$QUERY"
+fi
+
if ! $DIRTY ; then
echo "Everything seems to be fine."
echo