X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fcontrol_suite.py;h=ee55fcc59e5f8dbf16daf51917306161138ef0bf;hb=41c7c5fc96d6a4911be7bcf61f9850ae33844473;hp=aac6d717691dc9ea4c3940b5bfe1724cde158841;hpb=e746dde082b10ed638c61a6f1f806efbce959361;p=dak.git diff --git a/dak/control_suite.py b/dak/control_suite.py index aac6d717..ee55fcc5 100755 --- a/dak/control_suite.py +++ b/dak/control_suite.py @@ -43,6 +43,7 @@ import sys import apt_pkg +import os from daklib.config import Config from daklib.dbconn import * @@ -98,6 +99,19 @@ def britney_changelog(packages, suite, session): old = {} current = {} + Cnf = utils.get_conf() + + 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 brit_file: + brit_file = os.path.join(Cnf['Dir::Root'], brit_file) + else: + return q = session.execute("""SELECT s.source, s.version, sa.id FROM source s, src_associations sa @@ -129,14 +143,14 @@ def britney_changelog(packages, suite, session): 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]))