#!/usr/bin/env python
-
"""
-Database Update Script - Get suite_architectures table use sane values
+Get suite_architectures table use sane values
@contact: Debian FTP Master <ftpmaster@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
import psycopg2
from daklib.dak_exceptions import DBUpdateError
+from daklib.utils import get_conf
################################################################################
suites = {} #: Cache of existing suites
archs = {} #: Cache of existing architectures
-
def do_update(self):
""" Execute the DB update """
print "Lets make suite_architecture table use sane values"
+ Cnf = get_conf()
query = "INSERT into suite_architectures (suite, architecture) VALUES (%s, %s)" #: Update query
try:
architectures = Cnf.SubTree("Suite::" + suite).ValueList("Architectures")
suite = suite.lower()
for arch in architectures:
- c.execute(query, suites[suite], archs[arch])
+ c.execute(query, [suites[suite], archs[arch]])
+
+ c.execute("UPDATE config SET value = '4' WHERE name = 'db_revision'")
self.db.commit()