]> git.decadent.org.uk Git - dak.git/commitdiff
2005-01-14 Anthony Towns <ajt@debian.org> * kelly: when UNACCEPTing, don't double...
authorAnthony Towns <aj@azure.humbug.org.au>
Fri, 14 Jan 2005 14:07:17 +0000 (14:07 +0000)
committerAnthony Towns <aj@azure.humbug.org.au>
Fri, 14 Jan 2005 14:07:17 +0000 (14:07 +0000)
jennifer
katie.conf
katie.py
kelly

index 4b3bf44a386adf433cd1d43f29f6eb5bcbbc5dda..90fd13feae08eaf6fad353197726f3978862087a 100755 (executable)
--- a/jennifer
+++ b/jennifer
@@ -2,7 +2,7 @@
 
 # Checks Debian packages from Incoming
 # Copyright (C) 2000, 2001, 2002, 2003, 2004  James Troup <james@nocrew.org>
-# $Id: jennifer,v 1.54 2004-11-27 19:24:22 troup Exp $
+# $Id: jennifer,v 1.55 2005-01-14 14:07:17 ajt Exp $
 
 # 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
@@ -45,7 +45,7 @@ re_strip_revision = re.compile(r"-([^-]+)$");
 ################################################################################
 
 # Globals
-jennifer_version = "$Revision: 1.54 $";
+jennifer_version = "$Revision: 1.55 $";
 
 Cnf = None;
 Options = None;
@@ -274,6 +274,9 @@ def check_distributions():
                 changes["distribution"][dest] = 1;
                 if type != "silent-map":
                     reject("Mapping %s to %s." % (source, dest),"");
+            if changes.has_key("distribution-version"):
+                if changes["distribution-version"].has_key(source):
+                    changes["distribution-version"][source]=dest
         elif type == "map-unreleased":
             (source, dest) = args[1:3];
             if changes["distribution"].has_key(source):
@@ -292,6 +295,13 @@ def check_distributions():
             suite = args[1];
             if changes["distribution"].has_key(suite):
                 reject("Uploads to %s are not accepted." % (suite));
+        elif type == "propup-version":
+            # give these as "uploaded-to(non-mapped) suites-to-add-when-upload-obsoletes"
+            #
+            # changes["distribution-version"] looks like: {'testing': 'testing-proposed-updates'}
+            if args[1] in changes["distribution"]:
+                changes.setdefault("distribution-version", {})
+                for suite in args[2:]: changes["distribution-version"][suite]=suite
 
     # Ensure there is (still) a target distribution
     if changes["distribution"].keys() == []:
index 02b3e45c7b594946d8108ff06e218d53e524e4f5..14f73792e7e8683796966c2249d352fd3470c605 100644 (file)
@@ -205,9 +205,14 @@ Suite
          };
          MustBeOlderThan
          {
+           Testing;
            Unstable;
            Experimental;
          };
+         Enhances
+          {
+           Stable;
+         };
        };
   };
 
@@ -289,6 +294,10 @@ Suite
            Unstable;
            Experimental;
          };
+         Enhances
+          {
+           Testing;
+          };
        };
        UdebComponents
        {
@@ -397,6 +406,8 @@ Suite
 
 SuiteMappings
 {
+ "propup-version stable-security testing testing-proposed-updates unstable";
+ "propup-version testing-security unstable";
  "map stable proposed-updates";
  "map stable-security proposed-updates";
  "map-unreleased stable unstable";
index e898c2f01a41dff16726f4fa47ba41b440c67942..764daea2620abc5ca6c5c20eccb3cdd1002ee2e9 100644 (file)
--- a/katie.py
+++ b/katie.py
@@ -2,7 +2,7 @@
 
 # Utility functions for katie
 # Copyright (C) 2001, 2002, 2003, 2004  James Troup <james@nocrew.org>
-# $Id: katie.py,v 1.51 2004-11-27 18:02:22 troup Exp $
+# $Id: katie.py,v 1.52 2005-01-14 14:07:17 ajt Exp $
 
 # 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
@@ -176,7 +176,7 @@ class Katie:
                    "closes", "changes" ]:
             d_changes[i] = changes[i];
         # Optional changes fields
-        for i in [ "changed-by", "filecontents", "format", "lisa note" ]:
+        for i in [ "changed-by", "filecontents", "format", "lisa note", "distribution-version" ]:
             if changes.has_key(i):
                 d_changes[i] = changes[i];
         ## dsc
@@ -759,6 +759,17 @@ distribution.""";
 
     ################################################################################
 
+    def get_anyversion(self, query_result, suite):
+        anyversion=None
+        anysuite = [suite] + self.Cnf.ValueList("Suite::%s::VersionChecks::Enhances" % (suite))
+        for (v, s) in query_result:
+            if s in [ string.lower(x) for x in anysuite ]:
+                if not anyversion or apt_pkg.VersionCompare(anyversion, v) <= 0:
+                    anyversion=v
+        return anyversion
+
+    ################################################################################
+
     def cross_suite_version_check(self, query_result, file, new_version):
         """Ensure versions are newer than existing packages in target
         suites and that cross-suite version checking rules as
@@ -779,7 +790,46 @@ distribution.""";
                     self.reject("%s: old version (%s) in %s >= new version (%s) targeted at %s." % (file, existent_version, suite, new_version, target_suite));
                 if suite in must_be_older_than and \
                    apt_pkg.VersionCompare(new_version, existent_version) > -1:
-                    self.reject("%s: old version (%s) in %s <= new version (%s) targeted at %s." % (file, existent_version, suite, new_version, target_suite));
+                    ch = self.pkg.changes
+                    cansave = 0
+                    if ch.get('distribution-version', {}).has_key(suite):
+                        # we really use the other suite, ignoring the conflicting one ...
+                        addsuite = ch["distribution-version"][suite]
+                    
+                        add_version = self.get_anyversion(query_result, addsuite)
+                        target_version = self.get_anyversion(query_result, target_suite)
+                    
+                        if not add_version:
+                            # not add_version can only happen if we map to a suite
+                            # that doesn't enhance the suite we're propup'ing from.
+                            # so "propup-ver x a b c; map a d" is a problem only if
+                            # d doesn't enhance a.
+                            #
+                            # i think we could always propagate in this case, rather
+                            # than complaining. either way, this isn't a REJECT issue
+                            #
+                            # And - we really should complain to the dorks who configured dak
+                            self.reject("%s is mapped to, but not enhanced by %s - adding anyways" % (suite, addsuite), "Warning: ")
+                            self.pkg.changes["distribution"][addsuite] = 1
+                            cansave = 1
+                        elif not target_version:
+                            # not targets_version is true when the package is NEW
+                            # we could just stick with the "...old version..." REJECT
+                            # for this, I think.
+                            self.reject("Won't propogate NEW packages.")
+                        elif apt_pkg.VersionCompare(new_version, add_version) < 0:
+                            # propogation would be redundant. no need to reject though.
+                            #self.reject("ignoring versionconflict: %s: old version (%s) in %s <= new version (%s) targeted at %s." % (file, existent_version, suite, new_version, target_suite), "Warning: ");
+                            self.reject("foo", "Warning: ")
+                            cansave = 1
+                        elif apt_pkg.VersionCompare(new_version, add_version) > 0 and \
+                             apt_pkg.VersionCompare(add_version, target_version) == 0:
+                            # propogate!!
+                            self.pkg.changes["distribution"][addsuite] = 1
+                            cansave = 1
+                
+                    if not cansave:
+                        self.reject("%s: old version (%s) in %s <= new version (%s) targeted at %s." % (file, existent_version, suite, new_version, target_suite));
 
     ################################################################################
 
diff --git a/kelly b/kelly
index 37a4ac4f64f98218bb0f7c955b842bb4d73ba8b5..68d59a0b4e66ad28d4479db39be697870c2bb54b 100755 (executable)
--- a/kelly
+++ b/kelly
@@ -2,7 +2,7 @@
 
 # Installs Debian packages from queue/accepted into the pool
 # Copyright (C) 2000, 2001, 2002, 2003, 2004  James Troup <james@nocrew.org>
-# $Id: kelly,v 1.14 2004-03-11 00:20:51 troup Exp $
+# $Id: kelly,v 1.15 2005-01-14 14:07:17 ajt Exp $
 
 # 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
@@ -37,7 +37,7 @@ import db_access, katie, logging, utils;
 ###############################################################################
 
 # Globals
-kelly_version = "$Revision: 1.14 $";
+kelly_version = "$Revision: 1.15 $";
 
 Cnf = None;
 Options = None;
@@ -123,9 +123,9 @@ def check():
         # Version and file overwrite checks
         if not installing_to_stable:
             if files[file]["type"] == "deb":
-                reject(Katie.check_binary_against_db(file));
+                reject(Katie.check_binary_against_db(file), "");
             elif files[file]["type"] == "dsc":
-                reject(Katie.check_source_against_db(file));
+                reject(Katie.check_source_against_db(file), "");
                 (reject_msg, is_in_incoming) = Katie.check_dsc_against_db(file);
                 reject(reject_msg, "");