From 4ad042a29d9146189adfe62eeaa6c930e4764d4a Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Tue, 18 Nov 2014 01:52:34 +0100 Subject: reproducible: remove removed packages from db --- bin/reproducible_maintainance.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'bin') 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 -- cgit v1.2.3-70-g09d2