]> git.decadent.org.uk Git - dak.git/blobdiff - neve
close file descriptors after use, properly define options[debug]. [tbm]
[dak.git] / neve
diff --git a/neve b/neve
index b29e5a53d67cb4c9fc85adb017ee23cd86b0de96..21f7413150405386b6583c8c6b4fca62902611c4 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.9 2002-05-08 11:18:24 troup Exp $
+# $Id: neve,v 1.11 2002-05-18 23:55:15 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
@@ -37,7 +37,7 @@
 
 ###############################################################################
 
-import commands, os, pg, re, select, string, sys, tempfile, time;
+import commands, os, pg, re, select, string, tempfile, time;
 import apt_pkg;
 import db_access, utils;
 
@@ -148,7 +148,7 @@ def reject (str, prefix="Rejected: "):
 def check_signature (filename):
     if not utils.re_taint_free.match(os.path.basename(filename)):
         reject("!!WARNING!! tainted filename: '%s'." % (filename));
-        return 0;
+        return None;
 
     status_read, status_write = os.pipe();
     cmd = "gpgv --status-fd %s --keyring %s --keyring %s %s" \
@@ -309,7 +309,7 @@ def update_suites ():
         for i in ("Version", "Origin", "Description"):
             if SubSec.has_key(i):
                 projectB.query("UPDATE suite SET %s = '%s' WHERE suite_name = '%s'" % (string.lower(i), SubSec[i], string.lower(suite)))
-        for architecture in Cnf.SubTree("Suite::%s::Architectures" % (suite)).List():
+        for architecture in Cnf.ValueList("Suite::%s::Architectures" % (suite)):
             architecture_id = db_access.get_architecture_id (architecture);
             projectB.query("INSERT INTO suite_architectures (suite, architecture) VALUES (currval('suite_id_seq'), %d)" % (architecture_id));
 
@@ -566,9 +566,9 @@ def main ():
             print 'Processing '+location+'...';
             process_packages (location, packages, 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():
-                    for architecture in Cnf.SubTree("Suite::%s::Architectures" % (suite)).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'