X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fdakdb%2Fupdate2.py;h=0d9d387162fa45a9f0e23ae2ab1ab07fd86a352d;hb=f7e8ab5cc1ef088763a6e0f2b0cdba9ec2b63c87;hp=91fbe4f1f4b3a326901ce21162fa79bb014d3c15;hpb=b1c7475814393c70782179f6b9a49ef4aeabdfc6;p=dak.git diff --git a/dak/dakdb/update2.py b/dak/dakdb/update2.py index 91fbe4f1..0d9d3871 100755 --- a/dak/dakdb/update2.py +++ b/dak/dakdb/update2.py @@ -1,9 +1,14 @@ #!/usr/bin/env python # coding=utf8 -# Debian Archive Kit Database Update Script -# Copyright © 2008 Michael Casadevall -# Copyright © 2008 Roger Leigh +""" +debversion + +@contact: Debian FTP Master +@copyright: 2008 Michael Casadevall +@copyright: 2008 Roger Leigh +@license: GNU General Public License version 2 or later +""" # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,7 +26,9 @@ ################################################################################ -import psycopg2, time +import psycopg2 +import time +from daklib.dak_exceptions import DBUpdateError ################################################################################ @@ -37,6 +44,7 @@ def do_update(self): print "Enabling PL/Perl language" c.execute("CREATE LANGUAGE plperl;") + c.execute("CREATE LANGUAGE plpgsql;") print "Adding debversion type to database." @@ -388,8 +396,6 @@ $$ self.db.commit() - except psycopg2.ProgrammingError, msg: + except psycopg2.ProgrammingError as msg: self.db.rollback() - print "FATAL: Unable to apply debversion table update 2!" - print "Error Message: " + str(msg) - print "Database changes have been rolled back." + raise DBUpdateError("Unable to appy debversion updates, rollback issued. Error message : %s" % (str(msg)))