summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_maintainance.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/reproducible_maintainance.sh')
-rwxr-xr-xbin/reproducible_maintainance.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/bin/reproducible_maintainance.sh b/bin/reproducible_maintainance.sh
index f7682245..950a8d4a 100755
--- a/bin/reproducible_maintainance.sh
+++ b/bin/reproducible_maintainance.sh
@@ -101,6 +101,24 @@ 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
+ echo
+ 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