X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fupdate_db.py;h=ecf5cd2a80ac56589202f5a1d3bb4ebcbd68cd72;hb=1fa1f22b70c6ee46aea78ee40b9797a574d7c583;hp=92a02f721b83b2181650106122520da041afb98e;hpb=8d5c033bb1cc903c5ce7dc87b4122ea441fa28a3;p=dak.git diff --git a/dak/update_db.py b/dak/update_db.py index 92a02f72..ecf5cd2a 100755 --- a/dak/update_db.py +++ b/dak/update_db.py @@ -37,14 +37,14 @@ import os import apt_pkg import time import errno -from daklib import database + from daklib import utils +from daklib.dak_exceptions import DBUpdateError ################################################################################ Cnf = None -projectB = None -required_database_schema = 4 +required_database_schema = 15 ################################################################################ @@ -85,8 +85,6 @@ Updates dak's database schema to the lastest version. You should disable crontab ################################################################################ def get_db_rev(self): - global projectB - # We keep database revision info the config table # Try and access it @@ -143,7 +141,7 @@ Updates dak's database schema to the lastest version. You should disable crontab sys.exit(0) for i in range (database_revision, required_database_schema): - print "updating databse schema from " + str(database_revision) + " to " + str(i+1) + print "updating database schema from " + str(database_revision) + " to " + str(i+1) try: dakdb = __import__("dakdb", globals(), locals(), ['update'+str(i+1)]) update_module = getattr(dakdb, "update"+str(i+1)) @@ -158,7 +156,7 @@ Updates dak's database schema to the lastest version. You should disable crontab ################################################################################ def init (self): - global Cnf, projectB + global Cnf Cnf = utils.get_conf() arguments = [('h', "help", "Update-DB::Options::Help")]