]> git.decadent.org.uk Git - dak.git/commitdiff
Merge commit 'lamby/deb-src-3.0-sqla' into merge
authorJoerg Jaspert <joerg@debian.org>
Tue, 27 Oct 2009 14:51:48 +0000 (15:51 +0100)
committerJoerg Jaspert <joerg@debian.org>
Tue, 27 Oct 2009 14:51:48 +0000 (15:51 +0100)
* commit 'lamby/deb-src-3.0-sqla':
  Use the format id. not its name.
  Interpolate values properly.

Signed-off-by: Joerg Jaspert <joerg@debian.org>
dak/dakdb/update15.py

index 475d1d344d53d20402b346ce2de35e28dc9e2daf..6c000830b0be4bbca25db431b76df32672dbd578 100644 (file)
@@ -61,8 +61,10 @@ def do_update(self):
         print "Authorize format 1.0 on all suites by default"
         c.execute("SELECT id FROM suite")
         suites = c.fetchall()
+        c.execute("SELECT id FROM src_format WHERE format_name == '1.0'")
+        formats = c.fetchall()
         for s in suites:
-            c.execute("INSERT INTO suite_src_formats (suite, src_format) VALUES('%s', '%s')" % (s[0], '1.0'))
+            c.execute("INSERT INTO suite_src_formats (suite, src_format) VALUES(%s, %s)", (s[0], f[0]))
 
         print "Authorize all other formats on tpu, unstable & experimental by default"
         c.execute("SELECT id FROM suite WHERE suite_name IN ('testing-proposed-updates', 'unstable', 'experimental')")
@@ -71,7 +73,7 @@ def do_update(self):
         formats = c.fetchall()
         for s in suites:
             for f in formats:
-                c.execute("INSERT INTO suite_src_formats (suite, src_format) VALUES('%s', '%s')" % (s[0], f[0]))
+                c.execute("INSERT INTO suite_src_formats (suite, src_format) VALUES(%s, %s)", (s[0], f[0]))
 
         c.execute("UPDATE config SET value = '15' WHERE name = 'db_revision'")
         self.db.commit()