]> git.decadent.org.uk Git - dak.git/blobdiff - jennifer
remove useless code
[dak.git] / jennifer
index 9ea014854f01a979e470952c04f60480e7b52248..125d7d5dd70e42c774a3337a9e0d69975758b562 100755 (executable)
--- a/jennifer
+++ b/jennifer
@@ -2,7 +2,7 @@
 
 # Checks Debian packages from Incoming
 # Copyright (C) 2000, 2001, 2002  James Troup <james@nocrew.org>
-# $Id: jennifer,v 1.21 2002-05-19 00:47:16 troup Exp $
+# $Id: jennifer,v 1.23 2002-06-09 17:32:31 troup 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
@@ -43,7 +43,7 @@ re_is_changes = re.compile (r"(.+?)_(.+?)_(.+?)\.changes$");
 ################################################################################
 
 # Globals
-jennifer_version = "$Revision: 1.21 $";
+jennifer_version = "$Revision: 1.23 $";
 
 Cnf = None;
 Options = None;
@@ -419,30 +419,30 @@ def check_distributions():
     "Check and map the Distribution field of a .changes file."
 
     # Handle suite mappings
-    if Cnf.has_key("SuiteMappings"):
-        for map in Cnf.ValueList("SuiteMappings"):
-            args = string.split(map);
-            type = args[0];
-            if type == "map":
-                (source, dest) = args[1:3];
-                if changes["distribution"].has_key(source):
-                    del changes["distribution"][source]
-                    changes["distribution"][dest] = 1;
+    for map in Cnf.ValueList("SuiteMappings"):
+        args = string.split(map);
+        type = args[0];
+        if type == "map" or type == "silent-map":
+            (source, dest) = args[1:3];
+            if changes["distribution"].has_key(source):
+                del changes["distribution"][source]
+                changes["distribution"][dest] = 1;
+                if type != "silent-map":
                     reject("Mapping %s to %s." % (source, dest),"");
-            elif type == "map-unreleased":
-                (source, dest) = args[1:3];
-                if changes["distribution"].has_key(source):
-                    for arch in changes["architecture"].keys():
-                        if arch not in Cnf.ValueList("Suite::%s::Architectures" % (source)):
-                            reject("Mapping %s to %s for unreleased architecture %s." % (source, dest, arch),"");
-                            del changes["distribution"][source];
-                            changes["distribution"][dest] = 1;
-                            break;
-            elif type == "ignore":
-                suite = args[1];
-                if changes["distribution"].has_key(suite):
-                    del changes["distribution"][suite];
-                    reject("Ignoring %s as a target suite." % (suite), "Warning: ");
+        elif type == "map-unreleased":
+            (source, dest) = args[1:3];
+            if changes["distribution"].has_key(source):
+                for arch in changes["architecture"].keys():
+                    if arch not in Cnf.ValueList("Suite::%s::Architectures" % (source)):
+                        reject("Mapping %s to %s for unreleased architecture %s." % (source, dest, arch),"");
+                        del changes["distribution"][source];
+                        changes["distribution"][dest] = 1;
+                        break;
+        elif type == "ignore":
+            suite = args[1];
+            if changes["distribution"].has_key(suite):
+                del changes["distribution"][suite];
+                reject("Ignoring %s as a target suite." % (suite), "Warning: ");
 
     # Ensure there is (still) a target distribution
     if changes["distribution"].keys() == []:
@@ -546,9 +546,7 @@ def check_files():
                 files[file]["dbtype"] = "deb";
             else:
                 reject("%s is neither a .deb or a .udeb." % (file));
-            files[file]["source"] = control.Find("Source", "");
-            if files[file]["source"] == "":
-                files[file]["source"] = files[file]["package"];
+            files[file]["source"] = control.Find("Source", files[file]["package"]);
             # Get the source version
             source = files[file]["source"];
             source_version = ""
@@ -638,8 +636,14 @@ def check_files():
         for suite in changes["distribution"].keys():
             # Skip byhand
             if files[file].has_key("byhand"):
-                continue
+                continue;
 
+            # Handle component mappings
+            for map in Cnf.ValueList("ComponentMappings"):
+                (source, dest) = string.split(map);
+                if files[file]["component"] == source:
+                    files[file]["original component"] = source;
+                    files[file]["component"] = dest;
             # Ensure the component is valid for the target suite
             if Cnf.has_key("Suite:%s::Components" % (suite)) and \
                files[file]["component"] not in Cnf.ValueList("Suite::%s::Components" % (suite)):