]> git.donarmstrong.com Git - dak.git/commitdiff
Merge branch 'master' of ssh://franck.debian.org/srv/ftp.debian.org/git/dak
authorJoerg Jaspert <joerg@debian.org>
Sun, 19 Sep 2010 15:22:22 +0000 (17:22 +0200)
committerJoerg Jaspert <joerg@debian.org>
Sun, 19 Sep 2010 15:22:22 +0000 (17:22 +0200)
* 'master' of ssh://franck.debian.org/srv/ftp.debian.org/git/dak:
  Seems to work with 0.6 too

config/debian/dak.conf
dak/dakdb/update38.py [new file with mode: 0755]
dak/generate_releases.py
dak/update_db.py
daklib/dbconn.py
daklib/queue.py

index 0ba61e394800bf559c7b218fc8e028a50c3f60f8..c798617d4068bcd21dacec097d0a9071f1bb0d30 100644 (file)
@@ -205,10 +205,6 @@ Suite
          contrib;
          non-free;
        };
-       CopyChanges "dists/proposed-updates/";
-       CommentsDir "/srv/ftp-master.debian.org/queue/p-u-new/COMMENTS/";
-       OverrideSuite "stable";
-       ValidTime 604800; // 7 days
        VersionChecks
        {
          MustBeNewerThan
@@ -237,7 +233,6 @@ Suite
          contrib;
          non-free;
        };
-       ValidTime 604800; // 7 days
   };
 
   Testing-Proposed-Updates
@@ -248,8 +243,6 @@ Suite
          contrib;
          non-free;
        };
-       OverrideSuite "testing";
-       ValidTime 604800; // 7 days
        VersionChecks
        {
          MustBeNewerThan
@@ -279,8 +272,6 @@ Suite
          contrib;
          non-free;
        };
-       OverrideSuite "testing";
-       ValidTime 604800; // 7 days
        VersionChecks
        {
          MustBeNewerThan
@@ -304,7 +295,6 @@ Suite
          contrib;
          non-free;
        };
-       ValidTime 604800; // 7 days
        VersionChecks
        {
          MustBeNewerThan
@@ -326,8 +316,6 @@ Suite
          contrib;
          non-free;
        };
-       OverrideSuite "unstable";
-       ValidTime 604800; // 7 days
        VersionChecks
        {
          MustBeNewerThan
diff --git a/dak/dakdb/update38.py b/dak/dakdb/update38.py
new file mode 100755 (executable)
index 0000000..583aa3a
--- /dev/null
@@ -0,0 +1,56 @@
+#!/usr/bin/env python
+# coding=utf8
+
+"""
+Remove more unused table columns
+
+@contact: Debian FTP Master <ftpmaster@debian.org>
+@copyright: 2010 Joerg Jaspert <joerg@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
+
+################################################################################
+
+
+# <Ganneff> everyone - send your condolences to twerner, a new ftpmaster
+# <mhy> twerner: you poor, poor bastard
+# <mhy> twerner: look what it's done to me and Ganneff
+# <mhy> he used to be only 1.3m tall and I used to be female
+# <Tolimar> twerner: Congratulations... Uhm... Thorsta?
+# <Tolimar> Thorstine?
+# <DktrKranz> Thorstine seems the name of a candy we eat in Italy
+
+################################################################################
+
+import psycopg2
+from daklib.dak_exceptions import DBUpdateError
+
+################################################################################
+def do_update(self):
+    """
+    Remove unused table columns
+    """
+    print __doc__
+    try:
+        c = self.db.cursor()
+        c.execute('ALTER TABLE suite DROP COLUMN commentsdir')
+        c.execute("UPDATE config SET value = '38' WHERE name = 'db_revision'")
+        self.db.commit()
+
+    except psycopg2.ProgrammingError, msg:
+        self.db.rollback()
+        raise DBUpdateError, 'Unable to apply table-column update 38, rollback issued. Error message : %s' % (str(msg))
index 31cae490775dafcf10bcbd9e8967a6f0ab94089f..04627fc458ffc78d36e1f53de3ab684945ea2b4c 100755 (executable)
@@ -227,7 +227,7 @@ def main ():
 
         architectures = get_suite_architectures(suite, skipall=True, skipsrc=True)
 
-        if SuiteBlock.has_key("NotAutomatic"):
+        if suiteobj.notautomatic:
             notautomatic = "yes"
         else:
             notautomatic = ""
@@ -266,8 +266,8 @@ def main ():
             out.write("Codename: %s\n" % (codename))
         out.write("Date: %s\n" % (time.strftime("%a, %d %b %Y %H:%M:%S UTC", time.gmtime(time.time()))))
 
-        if SuiteBlock.has_key("ValidTime"):
-            validtime=float(SuiteBlock["ValidTime"])
+        if suiteobj.validtime:
+            validtime=float(suiteobj.validtime)
             out.write("Valid-Until: %s\n" % (time.strftime("%a, %d %b %Y %H:%M:%S UTC", time.gmtime(time.time()+validtime))))
 
         if notautomatic != "":
index 1046607016090a0b274b4e7654ee9b144b40d889..11e5b1e04f5b0a61817e6849bd52b9ff9afb3dee 100755 (executable)
@@ -45,7 +45,7 @@ from daklib.dak_exceptions import DBUpdateError
 ################################################################################
 
 Cnf = None
-required_database_schema = 37
+required_database_schema = 38
 
 ################################################################################
 
index 2ec1b60cdeaf7b5925ab73be15c1c4549afbb275..5a92dc8146c39e365b85f012b22a0a81717e1153 100755 (executable)
@@ -2483,7 +2483,6 @@ SUITE_FIELDS = [ ('SuiteName', 'suite_name'),
                  ('Priority', 'priority'),
                  ('NotAutomatic', 'notautomatic'),
                  ('CopyChanges', 'copychanges'),
-                 ('CommentsDir', 'commentsdir'),
                  ('OverrideSuite', 'overridesuite')]
 
 class Suite(object):
index c379b0bcf8c7d92c3292d1de3bae8a48805788a9..305d4838f985990137eb41c8c8ece58cca90e80d 100755 (executable)
@@ -162,18 +162,22 @@ def determine_new(filename, changes, files, warn=1, session = None):
     # Fix up the list of target suites
     cnf = Config()
     for suite in changes["suite"].keys():
-        override = cnf.Find("Suite::%s::OverrideSuite" % (suite))
-        if override:
-            (olderr, newerr) = (get_suite(suite, session) == None,
-                                get_suite(override, session) == None)
-            if olderr or newerr:
-                (oinv, newinv) = ("", "")
-                if olderr: oinv = "invalid "
-                if newerr: ninv = "invalid "
-                print "warning: overriding %ssuite %s to %ssuite %s" % (
-                        oinv, suite, ninv, override)
-            del changes["suite"][suite]
-            changes["suite"][override] = 1
+        oldsuite = get_suite(suite, session)
+        if not oldsuite:
+            print "WARNING: Invalid suite %s found" % suite
+            continue
+
+        if oldsuite.overridesuite:
+            newsuite = get_suite(oldsuite.overridesuite, session)
+
+            if newsuite:
+                print "WARNING: overriding suite %s to suite %s" % (
+                    suite, oldsuite.overridesuite)
+                del changes["suite"][suite]
+                changes["suite"][oldsuite.overridesuite] = 1
+            else:
+                print "WARNING: Told to use overridesuite %s for %s but it doesn't exist.  Bugger" % (
+                    oldsuite.overridesuite, suite)
 
     # Check for unprocessed byhand files
     if dbchg is not None:
@@ -2051,10 +2055,9 @@ distribution."""
             stats.accept_bytes += float(entry["size"])
 
         # Copy the .changes file across for suite which need it.
-        copy_changes = {}
-        for suite_name in self.pkg.changes["distribution"].keys():
-            if cnf.has_key("Suite::%s::CopyChanges" % (suite_name)):
-                copy_changes[cnf["Suite::%s::CopyChanges" % (suite_name)]] = ""
+        copy_changes = dict([(x.copychanges, '')
+                             for x in session.query(Suite).filter(Suite.suite_name.in_([self.pkg.changes["distribution"].keys()])).all()
+                             if x.copychanges is not None])
 
         for dest in copy_changes.keys():
             utils.copy(self.pkg.changes_file, os.path.join(cnf["Dir::Root"], dest))
@@ -2362,8 +2365,9 @@ distribution."""
             file_type = binary_type
 
         # Override suite name; used for example with proposed-updates
-        if cnf.Find("Suite::%s::OverrideSuite" % (suite)) != "":
-            suite = cnf["Suite::%s::OverrideSuite" % (suite)]
+        oldsuite = get_suite(suite, session)
+        if oldsuite.overridesuite:
+            suite = oldsuite.overridesuite
 
         result = get_override(package, suite, component, file_type, session)