]> git.decadent.org.uk Git - dak.git/blobdiff - dak/make_maintainers.py
Fix spelling of "IOError" so we indeed don't raise an exception
[dak.git] / dak / make_maintainers.py
index a7b576a6ff4ce5a90db519c916ceb789de621342..4a113b0c6a0793304ea2e6b8d87e146f53a1fcb1 100755 (executable)
@@ -131,9 +131,9 @@ def main():
 
     session = DBConn().session()
 
-    for suite in cnf.SubTree("Suite").List():
-        suite = suite.lower()
-        suite_priority = int(cnf["Suite::%s::Priority" % (suite)])
+    for suite in session.query(Suite).all():
+        suite_name = suite.suite_name
+        suite_priority = suite.priority
 
         # Source packages
         if gen_uploaders:
@@ -143,23 +143,23 @@ def main():
                                       AND sa.suite = su.id AND sa.source = s.id
                                       AND m.id = srcu.maintainer
                                       AND srcu.source = s.id""",
-                                    {'suite_name': suite})
+                                    {'suite_name': suite_name})
         else:
             q = session.execute("""SELECT s.source, s.version, m.name
                                      FROM src_associations sa, source s, suite su, maintainer m
                                     WHERE su.suite_name = :suite_name
                                       AND sa.suite = su.id AND sa.source = s.id
                                       AND m.id = s.maintainer""",
-                                    {'suite_name': suite})
+                                    {'suite_name': suite_name})
 
         for source in q.fetchall():
             package = source[0]
             version = source[1]
             maintainer = fix_maintainer(source[2])
-            if not gen_uploaders:
-                key = package
-            else:
+            if gen_uploaders:
                 key = (package, maintainer)
+            else:
+                key = package
 
             if packages.has_key(key):
                 if packages[key]["priority"] <= suite_priority:
@@ -175,13 +175,13 @@ def main():
                                     WHERE s.suite_name = :suite_name
                                       AND ba.suite = s.id AND ba.bin = b.id
                                       AND b.source = srcu.source""",
-                                   {'suite_name': suite})
+                                   {'suite_name': suite_name})
         else:
             q = session.execute("""SELECT b.package, b.source, b.maintainer, b.version
                                      FROM bin_associations ba, binaries b, suite s
                                     WHERE s.suite_name = :suite_name
                                       AND ba.suite = s.id AND ba.bin = b.id""",
-                                   {'suite_name': suite})
+                                   {'suite_name': suite_name})
 
 
         for binary in q.fetchall():
@@ -234,7 +234,8 @@ def main():
     package_keys.sort()
     if gen_uploaders:
         for (package, maintainer) in package_keys:
-            lhs = "~".join([package, packages[package]["version"]])
+            key = (package, maintainer)
+            lhs = "~".join([package, packages[key]["version"]])
             print "%-30s %s" % (lhs, maintainer)
     else:
         for package in package_keys: