X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fcontrol_suite.py;h=fcd4ca39562cf0c96e61f2364dc3e412a1b01ed0;hb=69f09ae38116af1a2f74db7eb6d9c84c23ed7384;hp=03cb73d57909fde42f03480658b17586559e0005;hpb=b9d08748685fb49aee70a702b6bae55385393f39;p=dak.git diff --git a/dak/control_suite.py b/dak/control_suite.py index 03cb73d5..fcd4ca39 100755 --- a/dak/control_suite.py +++ b/dak/control_suite.py @@ -99,6 +99,16 @@ def britney_changelog(packages, suite, session): old = {} current = {} + try: + q = session.execute("SELECT changelog FROM suite WHERE id = :suiteid", \ + {'suiteid': suite.suite_id}) + brit_file = q.fetchone()[0] + except: + brit_file = None + + if not brit_file: + return + q = session.execute("""SELECT s.source, s.version, sa.id FROM source s, src_associations sa WHERE sa.suite = :suiteid @@ -123,19 +133,20 @@ def britney_changelog(packages, suite, session): for p in new.keys(): query += " source = '%s' AND version > '%s' AND version <= '%s'" \ % (p, new[p][1], new[p][0]) - query += " AND architecture LIKE '%source%' OR" + query += " AND architecture LIKE '%source%' AND distribution in \ + ('unstable', 'experimental', 'testing-proposed-updates') OR" query += " False ORDER BY source, version DESC" q = session.execute(query) pu = None - brit = utils.open_file(Config()["Changelogs::Britney"], 'w') + brit = utils.open_file(brit_file, 'w') for u in q: if pu and pu != u[0]: brit.write("\n") brit.write("%s\n" % u[1]) pu = u[0] - if len(u): brit.write("\n\n\n") + if q.rowcount: brit.write("\n\n\n") for p in list(set(old.keys()).difference(current.keys())): brit.write("REMOVED: %s %s\n" % (p, old[p]))