]> git.decadent.org.uk Git - dak.git/blobdiff - dak/control_suite.py
Merge branch 'master' into security
[dak.git] / dak / control_suite.py
index aac6d717691dc9ea4c3940b5bfe1724cde158841..ee55fcc59e5f8dbf16daf51917306161138ef0bf 100755 (executable)
@@ -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]))