From: Ansgar Burchardt Date: Sun, 1 Jul 2012 15:19:03 +0000 (+0200) Subject: Drop column origin_server from archive table. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d30a62697b78f2e98c0d62c43c61880948ce9438;p=dak Drop column origin_server from archive table. --- diff --git a/dak/dakdb/update74.py b/dak/dakdb/update74.py new file mode 100644 index 00000000..89810f45 --- /dev/null +++ b/dak/dakdb/update74.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python +# coding=utf8 + +""" +Drop origin_server column from archive table + +@contact: Debian FTP Master +@copyright: 2012 Ansgar Burchardt +@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 +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +################################################################################ + +import psycopg2 +from daklib.dak_exceptions import DBUpdateError +from daklib.config import Config + +################################################################################ +def do_update(self): + print __doc__ + try: + cnf = Config() + + c = self.db.cursor() + + c.execute("ALTER TABLE archive DROP COLUMN origin_server") + + c.execute("UPDATE config SET value = '74' WHERE name = 'db_revision'") + self.db.commit() + + except psycopg2.ProgrammingError as msg: + self.db.rollback() + raise DBUpdateError('Unable to apply sick update 74, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/rm.py b/dak/rm.py index 37d9eee3..c2c1c62c 100755 --- a/dak/rm.py +++ b/dak/rm.py @@ -639,10 +639,8 @@ def main (): Archive = get_archive(whereami, session) if Archive is None: utils.warn("Cannot find archive %s. Setting blank values for origin" % whereami) - Subst_close_rm["__MASTER_ARCHIVE__"] = "" Subst_close_rm["__PRIMARY_MIRROR__"] = "" else: - Subst_close_rm["__MASTER_ARCHIVE__"] = Archive.origin_server Subst_close_rm["__PRIMARY_MIRROR__"] = Archive.primary_mirror for bug in utils.split_args(Options["Done"]): diff --git a/dak/update_db.py b/dak/update_db.py index 8b9fa32b..d9fea463 100755 --- a/dak/update_db.py +++ b/dak/update_db.py @@ -46,7 +46,7 @@ from daklib.daklog import Logger ################################################################################ Cnf = None -required_database_schema = 73 +required_database_schema = 74 ################################################################################ diff --git a/templates/rm.bug-close b/templates/rm.bug-close index fc229ed6..d3cd0908 100644 --- a/templates/rm.bug-close +++ b/templates/rm.bug-close @@ -17,9 +17,8 @@ database and may (or may not) still be in the pool; this is not a bug. The package(s) will be physically removed automatically when no suite references them (and in the case of source, when no binary references it). Please also remember that the changes have been done on the -master archive (__MASTER_ARCHIVE__) and will not propagate to any -mirrors (__PRIMARY_MIRROR__ included) until the next cron.daily run at the -earliest. +master archive and will not propagate to any mirrors (__PRIMARY_MIRROR__ +included) until the next dinstall run at the earliest. Packages are usually not removed from testing by hand. Testing tracks unstable and will automatically remove packages which were removed diff --git a/templates/rm.bug-close-with-related b/templates/rm.bug-close-with-related index 0dcc1b41..0cfabe7f 100644 --- a/templates/rm.bug-close-with-related +++ b/templates/rm.bug-close-with-related @@ -17,9 +17,8 @@ database and may (or may not) still be in the pool; this is not a bug. The package(s) will be physically removed automatically when no suite references them (and in the case of source, when no binary references it). Please also remember that the changes have been done on the -master archive (__MASTER_ARCHIVE__) and will not propagate to any -mirrors (__PRIMARY_MIRROR__ included) until the next cron.daily run at the -earliest. +master archive and will not propagate to any mirrors (__PRIMARY_MIRROR__ +included) until the next dinstall run at the earliest. Packages are usually not removed from testing by hand. Testing tracks unstable and will automatically remove packages which were removed