From: Anthony Towns Date: Fri, 14 Jan 2005 14:07:17 +0000 (+0000) Subject: 2005-01-14 Anthony Towns * kelly: when UNACCEPTing, don't double... X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=41b58850cb71d3fa204810b19cb0e00a46992fdb;p=dak 2005-01-14 Anthony Towns * kelly: when UNACCEPTing, don't double up the "Rejecting:" * propup stuff (thanks to Andreas Barth) * katie.conf: add stable MustBeOlderThan testing, add -security propup * jennifer: set distribution-version in .katie if propup may be needed * katie.py: add propogation to cross_suite_version_check --- diff --git a/jennifer b/jennifer index 4b3bf44a..90fd13fe 100755 --- a/jennifer +++ b/jennifer @@ -2,7 +2,7 @@ # Checks Debian packages from Incoming # Copyright (C) 2000, 2001, 2002, 2003, 2004 James Troup -# $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() == []: diff --git a/katie.conf b/katie.conf index 02b3e45c..14f73792 100644 --- a/katie.conf +++ b/katie.conf @@ -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"; diff --git a/katie.py b/katie.py index e898c2f0..764daea2 100644 --- a/katie.py +++ b/katie.py @@ -2,7 +2,7 @@ # Utility functions for katie # Copyright (C) 2001, 2002, 2003, 2004 James Troup -# $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 37a4ac4f..68d59a0b 100755 --- 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 -# $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, "");