From 2dbc6c7983dbbe935e0f4c2147448dae7d41b6c5 Mon Sep 17 00:00:00 2001 From: Joerg Jaspert Date: Sun, 19 Sep 2010 15:43:25 +0200 Subject: [PATCH] And priority taken out of database drop sorting in dak stats Signed-off-by: Joerg Jaspert --- config/backports/dak.conf | 4 ---- config/debian/dak.conf | 7 ------- dak/make_maintainers.py | 14 +++++++------- dak/stats.py | 12 ------------ 4 files changed, 7 insertions(+), 30 deletions(-) diff --git a/config/backports/dak.conf b/config/backports/dak.conf index 0440dca8..993cb80d 100644 --- a/config/backports/dak.conf +++ b/config/backports/dak.conf @@ -188,8 +188,6 @@ Suite contrib; non-free; }; - - Priority "7"; }; @@ -201,8 +199,6 @@ Suite contrib; non-free; }; - - Priority "7"; }; }; diff --git a/config/debian/dak.conf b/config/debian/dak.conf index eab1c8d4..718bdc24 100644 --- a/config/debian/dak.conf +++ b/config/debian/dak.conf @@ -195,7 +195,6 @@ Suite contrib; non-free; }; - Priority "5"; ChangeLogBase "dists/stable/"; }; @@ -212,7 +211,6 @@ Suite CommentsDir "/srv/ftp-master.debian.org/queue/p-u-new/COMMENTS/"; OverrideSuite "stable"; ValidTime 604800; // 7 days - Priority "4"; VersionChecks { MustBeNewerThan @@ -242,7 +240,6 @@ Suite non-free; }; ValidTime 604800; // 7 days - Priority "5"; }; Testing-Proposed-Updates @@ -255,7 +252,6 @@ Suite }; OverrideSuite "testing"; ValidTime 604800; // 7 days - Priority "6"; VersionChecks { MustBeNewerThan @@ -287,7 +283,6 @@ Suite }; OverrideSuite "testing"; ValidTime 604800; // 7 days - Priority "0"; VersionChecks { MustBeNewerThan @@ -312,7 +307,6 @@ Suite non-free; }; ValidTime 604800; // 7 days - Priority "7"; VersionChecks { MustBeNewerThan @@ -336,7 +330,6 @@ Suite }; OverrideSuite "unstable"; ValidTime 604800; // 7 days - Priority "0"; VersionChecks { MustBeNewerThan diff --git a/dak/make_maintainers.py b/dak/make_maintainers.py index 80e22153..4a113b0c 100755 --- a/dak/make_maintainers.py +++ b/dak/make_maintainers.py @@ -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,14 +143,14 @@ 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] @@ -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(): diff --git a/dak/stats.py b/dak/stats.py index 7c61e2a4..bbd58881 100755 --- a/dak/stats.py +++ b/dak/stats.py @@ -111,17 +111,6 @@ def longest(list): longest = l return longest -def suite_sort(a, b): - if Cnf.has_key("Suite::%s::Priority" % (a)): - a_priority = int(Cnf["Suite::%s::Priority" % (a)]) - else: - a_priority = 0 - if Cnf.has_key("Suite::%s::Priority" % (b)): - b_priority = int(Cnf["Suite::%s::Priority" % (b)]) - else: - b_priority = 0 - return cmp(a_priority, b_priority) - def output_format(suite): output_suite = [] for word in suite.split("-"): @@ -164,7 +153,6 @@ def number_of_packages(): ## Print the results # Setup suite_list = suites.values() - suite_list.sort(suite_sort) suite_id_list = [] suite_arches = {} for suite in suite_list: -- 2.39.5