X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fupdate_db.py;h=e0a4b9bb15a4c27dfc9a2cddc0110a4feaed9d2b;hb=947925a17d8a911f0deb970ecb6ce7a54fa36fab;hp=fc2e3e17e0fb808b3f7dc1181e80f87f26bf08fd;hpb=abab69847a509e0b50a4b30edaf98d1fbebafe0d;p=dak.git diff --git a/dak/update_db.py b/dak/update_db.py index fc2e3e17..e0a4b9bb 100755 --- a/dak/update_db.py +++ b/dak/update_db.py @@ -37,7 +37,7 @@ import os import apt_pkg import time import errno -from daklib import database + from daklib import utils from daklib.dak_exceptions import DBUpdateError @@ -45,7 +45,7 @@ from daklib.dak_exceptions import DBUpdateError Cnf = None projectB = None -required_database_schema = 4 +required_database_schema = 13 ################################################################################ @@ -86,8 +86,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 @@ -144,7 +142,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)) @@ -159,7 +157,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")]