]> git.decadent.org.uk Git - dak.git/blobdiff - jennifer
clean buildd dbs too. run symlinks -rd on ftpdir
[dak.git] / jennifer
index 3da7f8f2a356ad463826e2c5cacf43221584548e..30223327b6a4dcab717d8fe5e2a87abcfa02a4ba 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.19 2002-05-14 22:28:01 troup Exp $
+# $Id: jennifer,v 1.22 2002-06-08 00:17:57 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.19 $";
+jennifer_version = "$Revision: 1.22 $";
 
 Cnf = None;
 Options = None;
@@ -311,7 +311,7 @@ def copy_to_holding(filename):
     try:
         shutil.copy(filename, dest);
     except IOError, e:
-        # In either case (ENOENT or EPERM) we want to remove the
+        # In either case (ENOENT or EACCES) we want to remove the
         # O_CREAT | O_EXCLed ghost file, so add the file to the list
         # of 'in holding' even if it's not the real file.
         if errno.errorcode[e.errno] == 'ENOENT':
@@ -355,7 +355,7 @@ def check_changes():
 
     # Parse the .changes field into a dictionary
     try:
-        changes.update(utils.parse_changes(filename, 0));
+        changes.update(utils.parse_changes(filename));
     except utils.cant_open_exc:
         reject("can't read changes file '%s'." % (filename));
         return 0;
@@ -365,7 +365,7 @@ def check_changes():
 
     # Parse the Files field from the .changes into another dictionary
     try:
-        files.update(utils.build_file_list(changes, ""));
+        files.update(utils.build_file_list(changes));
     except utils.changes_parse_error_exc, line:
         reject("error parsing changes file '%s', can't grok: %s." % (filename, line));
     except utils.nk_format_exc, format:
@@ -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() == []:
@@ -638,8 +638,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)):
@@ -713,7 +719,7 @@ def check_dsc ():
         if files[file]["type"] == "dsc":
             # Parse the .dsc file
             try:
-                dsc.update(utils.parse_changes(file, 1));
+                dsc.update(utils.parse_changes(file, dsc_whitespace_rules=1));
             except utils.cant_open_exc:
                 # if not -n copy_to_holding() will have done this for us...
                 if Options["No-Action"]:
@@ -724,7 +730,7 @@ def check_dsc ():
                 reject("syntax error in .dsc file '%s', line %s." % (file, line));
             # Build up the file list of files mentioned by the .dsc
             try:
-                dsc_files.update(utils.build_file_list(dsc, 1));
+                dsc_files.update(utils.build_file_list(dsc, is_a_dsc=1));
             except utils.no_files_exc:
                 reject("no Files: field in .dsc file.");
                 continue;