]> git.decadent.org.uk Git - dak.git/commitdiff
Finds newer or equal versions in lowersuite_name
authorLuca Falavigna <dktrkranz@debian.org>
Sun, 21 Apr 2013 01:02:50 +0000 (01:02 +0000)
committerLuca Falavigna <dktrkranz@debian.org>
Sun, 21 Apr 2013 01:04:29 +0000 (01:04 +0000)
This is particularly useful when the same package has migrated
to a different suite (e.g. t-p-u -> testing), so it is displayed
in cruft-report to be manually removed.

daklib/cruft.py

index f060085d72f98478bbc70e64d47292adaec2ce94..fc98eafbea857dc89baae84f7240b4879d0137d7 100644 (file)
@@ -28,10 +28,10 @@ from sqlalchemy.orm import object_session
 
 def newer_version(lowersuite_name, highersuite_name, session):
     '''
-    Finds newer versions in lowersuite_name than in highersuite_name. Returns a
-    list of tuples (source, higherversion, lowerversion) where higherversion is
-    the newest version from highersuite_name and lowerversion is the newest
-    version from lowersuite_name.
+    Finds newer or equal versions in lowersuite_name than in highersuite_name.
+    Returns a list of tuples (source, higherversion, lowerversion) where
+    higherversion is the newest version from highersuite_name and lowerversion
+    is the newest version from lowersuite_name.
     '''
 
     lowersuite = get_suite(lowersuite_name, session)
@@ -43,7 +43,7 @@ def newer_version(lowersuite_name, highersuite_name, session):
     list = []
     for (source, higherversion) in query:
         lowerversion = session.query(func.max(DBSource.version)). \
-            filter_by(source = source).filter(DBSource.version > higherversion). \
+            filter_by(source = source).filter(DBSource.version >= higherversion). \
             with_parent(lowersuite).group_by(DBSource.source).scalar()
         if lowerversion is not None:
             list.append((source, higherversion, lowerversion))