]> err.no Git - dak/commitdiff
make-maintainers
authorJoerg Jaspert <joerg@debian.org>
Fri, 22 Jan 2010 21:23:18 +0000 (22:23 +0100)
committerJoerg Jaspert <joerg@debian.org>
Fri, 22 Jan 2010 21:23:18 +0000 (22:23 +0100)
reverse the irritating order

Signed-off-by: Joerg Jaspert <joerg@debian.org>
dak/make_maintainers.py

index e88c7fc3ac6ece17566997bdaace7ea7d94eaab5..a7b576a6ff4ce5a90db519c916ceb789de621342 100755 (executable)
@@ -136,20 +136,20 @@ def main():
         suite_priority = int(cnf["Suite::%s::Priority" % (suite)])
 
         # Source packages
-        if not gen_uploaders:
+        if gen_uploaders:
             q = session.execute("""SELECT s.source, s.version, m.name
-                                     FROM src_associations sa, source s, suite su, maintainer m
+                                     FROM src_associations sa, source s, suite su, maintainer m, src_uploaders srcu
                                     WHERE su.suite_name = :suite_name
                                       AND sa.suite = su.id AND sa.source = s.id
-                                      AND m.id = s.maintainer""",
+                                      AND m.id = srcu.maintainer
+                                      AND srcu.source = s.id""",
                                     {'suite_name': suite})
         else:
             q = session.execute("""SELECT s.source, s.version, m.name
-                                     FROM src_associations sa, source s, suite su, maintainer m, src_uploaders srcu
+                                     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 = srcu.maintainer
-                                      AND srcu.source = s.id""",
+                                      AND m.id = s.maintainer""",
                                     {'suite_name': suite})
 
         for source in q.fetchall():
@@ -169,19 +169,19 @@ def main():
                 packages[key] = { "maintainer": maintainer, "priority": suite_priority, "version": version }
 
         # Binary packages
-        if not gen_uploaders:
-            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})
-        else:
+        if gen_uploaders:
             q = session.execute("""SELECT b.package, b.source, srcu.maintainer, b.version
                                      FROM bin_associations ba, binaries b, suite s, src_uploaders srcu
                                     WHERE s.suite_name = :suite_name
                                       AND ba.suite = s.id AND ba.bin = b.id
                                       AND b.source = srcu.source""",
                                    {'suite_name': suite})
+        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})
 
 
         for binary in q.fetchall():
@@ -193,10 +193,10 @@ def main():
                 maintainer = get_maintainer_from_source(source_id, session)
             else:
                 maintainer = get_maintainer(binary[2], session)
-            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:
@@ -232,14 +232,14 @@ def main():
 
     package_keys = packages.keys()
     package_keys.sort()
-    if not gen_uploaders:
-        for package in package_keys:
-            lhs = "~".join([package, packages[package]["version"]])
-            print "%-30s %s" % (lhs, packages[package]["maintainer"])
-    else:
+    if gen_uploaders:
         for (package, maintainer) in package_keys:
             lhs = "~".join([package, packages[package]["version"]])
             print "%-30s %s" % (lhs, maintainer)
+    else:
+        for package in package_keys:
+            lhs = "~".join([package, packages[package]["version"]])
+            print "%-30s %s" % (lhs, packages[package]["maintainer"])
 
 ################################################################################