]> git.decadent.org.uk Git - dak.git/blobdiff - neve
* katie.py (in_override_p): when searching for a source override, and the...
[dak.git] / neve
diff --git a/neve b/neve
index 21f7413150405386b6583c8c6b4fca62902611c4..eb94e2e3e72c2ff9ff3a20d4858060df8cce2e81 100755 (executable)
--- a/neve
+++ b/neve
@@ -2,7 +2,7 @@
 
 # Populate the DB
 # Copyright (C) 2000, 2001, 2002  James Troup <james@nocrew.org>
-# $Id: neve,v 1.11 2002-05-18 23:55:15 troup Exp $
+# $Id: neve,v 1.13 2002-06-09 17:33:46 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
@@ -171,7 +171,7 @@ def check_signature (filename):
             internal_error = internal_error + "gpgv status line is malformed (incorrect prefix '%s').\n" % (gnupg);
             continue;
         args = split[2:];
-        if keywords.has_key(keyword) and keyword != "NODATA":
+        if keywords.has_key(keyword) and keyword != "NODATA" and keyword != "SIGEXPIRED":
             internal_error = internal_error + "found duplicate status token ('%s')." % (keyword);
             continue;
         else:
@@ -186,8 +186,7 @@ def check_signature (filename):
 
     # Now check for obviously bad things in the processed output
     if keywords.has_key("SIGEXPIRED"):
-        reject("key used to sign %s has expired." % (filename));
-        bad = 1;
+        utils.warn("%s: signing key has expired." % (filename));
     if keywords.has_key("KEYREVOKED"):
         reject("key used to sign %s has been revoked." % (filename));
         bad = 1;
@@ -313,6 +312,16 @@ def update_suites ():
             architecture_id = db_access.get_architecture_id (architecture);
             projectB.query("INSERT INTO suite_architectures (suite, architecture) VALUES (currval('suite_id_seq'), %d)" % (architecture_id));
 
+def update_override_type():
+    projectB.query("DELETE FROM override_type");
+    for type in Cnf.ValueList("OverrideType"):
+        projectB.query("INSERT INTO override_type (type) VALUES ('%s')" % (type));
+
+def update_priority():
+    projectB.query("DELETE FROM priority");
+    for priority in Cnf.SubTree("Priority").List():
+        projectB.query("INSERT INTO priority (priority, level) VALUES ('%s', %s)" % (priority, Cnf["Priority::%s" % (priority)]));
+
 ###############################################################################
 
 def get_or_set_files_id (filename, size, md5sum, location_id):
@@ -333,8 +342,6 @@ def process_sources (location, filename, suite, component, archive, dsc_dir):
 
     suite = string.lower(suite);
     suite_id = db_access.get_suite_id(suite);
-    if suite == 'stable':
-        testing_id = db_access.get_suite_id("testing");
     try:
         file = utils.open_file (filename);
     except utils.cant_open_exc:
@@ -398,10 +405,6 @@ def process_sources (location, filename, suite, component, archive, dsc_dir):
 
         src_associations_id_serial = src_associations_id_serial + 1;
         src_associations_query_cache.write("%d\t%d\t%d\n" % (src_associations_id_serial, suite_id, tmp_source_id))
-        # populate 'testing' with a mirror of 'stable'
-        if suite == "stable":
-            src_associations_id_serial = src_associations_id_serial + 1;
-            src_associations_query_cache.write("%d\t%d\t%d\n" % (src_associations_id_serial, testing_id, tmp_source_id))
 
     file.close();
 
@@ -414,8 +417,6 @@ def process_packages (location, filename, suite, component, archive):
     count_bad = 0;
     suite = string.lower(suite);
     suite_id = db_access.get_suite_id(suite);
-    if suite == "stable":
-        testing_id = db_access.get_suite_id("testing");
     try:
         file = utils.open_file (filename);
     except utils.cant_open_exc:
@@ -473,9 +474,6 @@ def process_packages (location, filename, suite, component, archive):
 
             bin_associations_id_serial = bin_associations_id_serial + 1;
             bin_associations_query_cache.write("%d\t%d\t%d\n" % (bin_associations_id_serial, suite_id, tmp_binaries_id));
-            if suite == "stable":
-                bin_associations_id_serial = bin_associations_id_serial + 1;
-                bin_associations_query_cache.write("%d\t%d\t%d\n" % (bin_associations_id_serial, testing_id, tmp_binaries_id));
             count_total = count_total +1;
 
     file.close();
@@ -522,6 +520,8 @@ def main ():
     update_archives();
     update_locations();
     update_suites();
+    update_override_type();
+    update_priority();
     projectB.query("COMMIT WORK");
 
     files_query_cache = utils.open_file(Cnf["Neve::ExportDir"]+"files","w");
@@ -542,9 +542,9 @@ def main ():
             suite = Cnf.Find("Location::%s::Suite" % (location));
             do_sources(location, prefix, suite, "",  server);
         elif type == "legacy":
-            for suite in Cnf.SubTree("Location::%s::Suites" % (location)).List():
+            for suite in Cnf.ValueList("Location::%s::Suites" % (location)):
                 for component in Cnf.SubTree("Component").List():
-                    prefix = Cnf.Find("Suite::%s::CodeName" % (suite)) + '/' + component + '/source/'
+                    prefix = Cnf["Suite::%s::CodeName" % (suite)] + '/' + component + '/source/'
                     do_sources(location, prefix, suite, component, server);
         elif type == "pool":
             continue;
@@ -568,10 +568,10 @@ def main ():
         elif type == "legacy":
             for suite in Cnf.ValueList("Location::%s::Suites" % (location)):
                 for component in Cnf.SubTree("Component").List():
-                    for architecture in Cnf.ValueList("Suite::%s::Architectures" % (suite)):
-                        if architecture == "source" or architecture == "all":
-                            continue;
-                        packages = location + Cnf.Find("Suite::%s::CodeName" % (suite)) + '/' + component + '/binary-' + architecture + '/Packages'
+                    architectures = filter(utils.real_arch,
+                                           Cnf.ValueList("Suite::%s::Architectures" % (suite)));
+                    for architecture in architectures:
+                        packages = location + Cnf["Suite::%s::CodeName" % (suite)] + '/' + component + '/binary-' + architecture + '/Packages'
                         print 'Processing '+packages+'...';
                         process_packages (location, packages, suite, component, server);
         elif type == "pool":