]> err.no Git - dak/commitdiff
Use the database instead of Lists for check_archive
authorMark Hymers <mhy@debian.org>
Wed, 27 Jul 2011 08:08:12 +0000 (09:08 +0100)
committerMark Hymers <mhy@debian.org>
Wed, 27 Jul 2011 08:08:12 +0000 (09:08 +0100)
Signed-off-by: Mark Hymers <mhy@debian.org>
dak/check_archive.py

index a88f8ebaaacbcf99a9d705b1c233af2a4d0a93cf..53db5ba7256aee3453f3f8ae0f8f6cb80e6b68d2 100755 (executable)
@@ -148,26 +148,18 @@ def check_dscs():
     Parse every .dsc file in the archive and check for it's validity.
     """
 
-    cnf = Config()
-
     count = 0
-    suite = 'unstable'
-
-    for component in cnf.SubTree("Component").List():
-        component = component.lower()
-        list_filename = '%s%s_%s_source.list' % (cnf["Dir::Lists"], suite, component)
-        list_file = utils.open_file(list_filename)
-
-        for line in list_file.readlines():
-            f = line[:-1]
-            try:
-                utils.parse_changes(f, signing_rules=1, dsc_file=1)
-            except InvalidDscError, line:
-                utils.warn("syntax error in .dsc file '%s', line %s." % (f, line))
-                count += 1
-            except ChangesUnicodeError:
-                utils.warn("found invalid changes file, not properly utf-8 encoded")
-                count += 1
+
+    for dsc_file in DBConn().session().query(DSCFile):
+        f = dsc_file.poolfile.fullpath
+        try:
+            utils.parse_changes(f, signing_rules=1, dsc_file=1)
+        except InvalidDscError, line:
+            utils.warn("syntax error in .dsc file %s" % f)
+            count += 1
+        except ChangesUnicodeError:
+            utils.warn("found invalid dsc file (%s), not properly utf-8 encoded" % f)
+            count += 1
 
     if count:
         utils.warn("Found %s invalid .dsc files." % (count))