]> git.decadent.org.uk Git - dak.git/blobdiff - dak/control_suite.py
Check brit_file value, it can be None
[dak.git] / dak / control_suite.py
index b862e215448167f3bbb696b88b2df4771ef4808e..fcd4ca39562cf0c96e61f2364dc3e412a1b01ed0 100755 (executable)
@@ -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
@@ -129,14 +139,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(q): 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]))