]> git.decadent.org.uk Git - dak.git/blobdiff - dak/dakdb/update8.py
Add ordering to component table and use this when checking policy
[dak.git] / dak / dakdb / update8.py
old mode 100755 (executable)
new mode 100644 (file)
index fc505f7..6bacd4e
@@ -2,11 +2,12 @@
 # coding=utf8
 
 """
-Debian Archive Kit Database Update Script
-Copyright © 2008  Michael Casadevall <mcasadevall@debian.org>
-Copyright © 2009  Joerg Jaspert <joerg@debian.org>
+More suite config into the DB
 
-Debian Archive Kit Database Update Script 8
+@contact: Debian FTP Master <ftpmaster@debian.org>
+@copyright: 2008  Michael Casadevall <mcasadevall@debian.org>
+@copyright: 2009  Joerg Jaspert <joerg@debian.org>
+@license: GNU General Public License version 2 or later
 """
 
 # This program is free software; you can redistribute it and/or modify
@@ -47,8 +48,8 @@ def do_update(self):
 
         c.execute("ALTER TABLE suite ADD COLUMN copychanges TEXT;")
         query = "UPDATE suite SET copychanges = %s WHERE suite_name = %s"  #: Update query
-        for suite in Cnf.SubTree("Suite").List():
-            copychanges = Cnf.Find("Suite::%s::CopyChanges" % (suite))
+        for suite in Cnf.subtree("Suite").list():
+            copychanges = Cnf.find("Suite::%s::CopyChanges" % (suite))
             print "[CopyChanges] Processing suite %s" % (suite)
             if not copychanges:
                 continue
@@ -57,8 +58,8 @@ def do_update(self):
 
         c.execute("ALTER TABLE suite ADD COLUMN copydotdak TEXT;")
         query = "UPDATE suite SET copydotdak = %s WHERE suite_name = %s"  #: Update query
-        for suite in Cnf.SubTree("Suite").List():
-            copydotdak = Cnf.Find("Suite::%s::CopyDotDak" % (suite))
+        for suite in Cnf.subtree("Suite").list():
+            copydotdak = Cnf.find("Suite::%s::CopyDotDak" % (suite))
             print "[CopyDotDak] Processing suite %s" % (suite)
             if not copydotdak:
                 continue
@@ -67,8 +68,8 @@ def do_update(self):
 
         c.execute("ALTER TABLE suite ADD COLUMN commentsdir TEXT;")
         query = "UPDATE suite SET commentsdir = %s WHERE suite_name = %s"  #: Update query
-        for suite in Cnf.SubTree("Suite").List():
-            commentsdir = Cnf.Find("Suite::%s::CommentsDir" % (suite))
+        for suite in Cnf.subtree("Suite").list():
+            commentsdir = Cnf.find("Suite::%s::CommentsDir" % (suite))
             print "[CommentsDir] Processing suite %s" % (suite)
             if not commentsdir:
                 continue
@@ -77,8 +78,8 @@ def do_update(self):
 
         c.execute("ALTER TABLE suite ADD COLUMN overridesuite TEXT;")
         query = "UPDATE suite SET overridesuite = %s WHERE suite_name = %s"  #: Update query
-        for suite in Cnf.SubTree("Suite").List():
-            overridesuite = Cnf.Find("Suite::%s::OverrideSuite" % (suite))
+        for suite in Cnf.subtree("Suite").list():
+            overridesuite = Cnf.find("Suite::%s::OverrideSuite" % (suite))
             print "[OverrideSuite] Processing suite %s" % (suite)
             if not overridesuite:
                 continue
@@ -87,8 +88,8 @@ def do_update(self):
 
         c.execute("ALTER TABLE suite ADD COLUMN changelogbase TEXT;")
         query = "UPDATE suite SET changelogbase = %s WHERE suite_name = %s"  #: Update query
-        for suite in Cnf.SubTree("Suite").List():
-            changelogbase = Cnf.Find("Suite::%s::ChangeLogBase" % (suite))
+        for suite in Cnf.subtree("Suite").list():
+            changelogbase = Cnf.find("Suite::%s::ChangeLogBase" % (suite))
             print "[ChangeLogBase] Processing suite %s" % (suite)
             if not changelogbase:
                 continue
@@ -98,6 +99,6 @@ def do_update(self):
         c.execute("UPDATE config SET value = '8' WHERE name = 'db_revision'")
         self.db.commit()
 
-    except psycopg2.ProgrammingError, msg:
+    except psycopg2.ProgrammingError as msg:
         self.db.rollback()
-        raise DBUpdateError, "Unable to apply suite config updates, rollback issued. Error message : %s" % (str(msg))
+        raise DBUpdateError("Unable to apply suite config updates, rollback issued. Error message : %s" % (str(msg)))