[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[dak/master] Drop column origin_server from archive table.



---
 dak/dakdb/update74.py               |   47 +++++++++++++++++++++++++++++++++++
 dak/rm.py                           |    2 -
 dak/update_db.py                    |    2 +-
 templates/rm.bug-close              |    5 +--
 templates/rm.bug-close-with-related |    5 +--
 5 files changed, 52 insertions(+), 9 deletions(-)
 create mode 100644 dak/dakdb/update74.py

diff --git a/dak/dakdb/update74.py b/dak/dakdb/update74.py
new file mode 100644
index 0000000..89810f4
--- /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 <ftpmaster@debian.org>
+@copyright: 2012 Ansgar Burchardt <ansgar@debian.org>
+@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 37d9eee..c2c1c62 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 8b9fa32..d9fea46 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 fc229ed..d3cd090 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 0dcc1b4..0cfabe7 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
-- 
1.7.2.5


Reply to: