X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=jennifer;h=90fd13feae08eaf6fad353197726f3978862087a;hb=fbd8a56ae94699a3071100ec71ea9d4291a4e762;hp=e9f575c517eed5567d78be6387b31c3a98b8413a;hpb=df1a2290b6e6d77ad17ccbc985f1054e960f2260;p=dak.git diff --git a/jennifer b/jennifer index e9f575c5..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.52 2004-11-27 13:32:16 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.52 $"; +jennifer_version = "$Revision: 1.55 $"; Cnf = None; Options = None; @@ -180,11 +180,6 @@ def clean_holding(): def check_changes(): filename = pkg.changes_file; - # Defaults in case we bail out - changes["maintainer2047"] = Cnf["Dinstall::MyEmailAddress"]; - changes["changedby2047"] = Cnf["Dinstall::MyEmailAddress"]; - changes["architecture"] = {}; - # Parse the .changes field into a dictionary try: changes.update(utils.parse_changes(filename)); @@ -279,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): @@ -293,6 +291,17 @@ def check_distributions(): if changes["distribution"].has_key(suite): del changes["distribution"][suite]; reject("Ignoring %s as a target suite." % (suite), "Warning: "); + elif type == "reject": + 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() == []: @@ -659,7 +668,7 @@ def check_dsc(): utils.fix_maintainer (dsc["maintainer"]); except utils.ParseMaintError, msg: reject("%s: Maintainer field ('%s') failed to parse: %s" \ - % (dsc_filename, changes["changed-by"], msg)); + % (dsc_filename, dsc["maintainer"], msg)); # Validate the build-depends field(s) for field_name in [ "build-depends", "build-depends-indep" ]: @@ -1110,6 +1119,9 @@ def process_it (changes_file): # Reset some globals reprocess = 1; Katie.init_vars(); + # Some defaults in case we can't fully process the .changes file + changes["maintainer2047"] = Cnf["Dinstall::MyEmailAddress"]; + changes["changedby2047"] = Cnf["Dinstall::MyEmailAddress"]; reject_message = ""; # Absolutize the filename to avoid the requirement of being in the @@ -1130,7 +1142,10 @@ def process_it (changes_file): # rather than the original... pkg.changes_file = os.path.basename(pkg.changes_file); changes["fingerprint"] = utils.check_signature(pkg.changes_file, reject); - valid_changes_p = check_changes(); + if changes["fingerprint"]: + valid_changes_p = check_changes(); + else: + valid_changes_p = 0; if valid_changes_p: while reprocess: check_distributions();