#!/usr/bin/env python
 
 # Poolify (move packages from "legacy" type locations to pool locations)
-# Copyright (C) 2000, 2001, 2002, 2003  James Troup <james@nocrew.org>
-# $Id: catherine,v 1.18 2003-09-07 13:52:50 troup Exp $
+# Copyright (C) 2000, 2001, 2002, 2003, 2004  James Troup <james@nocrew.org>
+# $Id: catherine,v 1.19 2004-03-11 00:20:51 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
         base_filename = os.path.basename(legacy_filename);
         destination_filename = base_filename;
         # Work out the source package name
-        if re_isadeb.match(base_filename) != None:
+        if re_isadeb.match(base_filename):
             control = apt_pkg.ParseSection(apt_inst.debExtractControl(utils.open_file(legacy_filename)))
             package = control.Find("Package", "");
             source = control.Find("Source", package);
             destination_filename = "%s_%s_%s.deb" % (package, version, architecture);
         else:
             m = utils.re_issource.match(base_filename)
-            if m != None:
+            if m:
                 source = m.group(1);
             else:
                 utils.fubar("expansion of source filename '%s' failed." % (legacy_filename));
 
 #!/usr/bin/env python
 
 # Generate Maintainers file used by e.g. the Debian Bug Tracking System
-# Copyright (C) 2000, 2001, 2002, 2003  James Troup <james@nocrew.org>
-# $Id: charisma,v 1.16 2003-04-15 16:03:31 troup Exp $
+# Copyright (C) 2000, 2001, 2002, 2003, 2004  James Troup <james@nocrew.org>
+# $Id: charisma,v 1.17 2004-03-11 00:20:51 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
             source_id = binary[1];
             version = binary[3];
             # Use the source maintainer first; falling back on the binary maintainer as a last resort only
-            if source_id != 0 and source_id != None:
+            if source_id:
                 maintainer = get_maintainer_from_source(source_id);
             else:
                 maintainer = get_maintainer(binary[2]);
 
 
 # Remove obsolete .changes files from proposed-updates
 # Copyright (C) 2001, 2002, 2003, 2004  James Troup <james@nocrew.org>
-# $Id: halle,v 1.11 2004-02-27 20:07:40 troup Exp $
+# $Id: halle,v 1.12 2004-03-11 00:20:51 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
         return;
     num_files = len(files.keys());
     for file in files.keys():
-        if utils.re_isadeb.match(file) != None:
+        if utils.re_isadeb.match(file):
             m = re_isdeb.match(file);
             pkg = m.group(1);
             version = m.group(2);
                 print "BINARY: %s ==> %s_%s_%s" % (file, pkg, version, arch);
         else:
             m = utils.re_issource.match(file)
-            if m != None:
+            if m:
                 pkg = m.group(1);
                 version = m.group(2);
                 type = m.group(3);
 
 #!/usr/bin/env python
 
 # Manipulate suite tags
-# Copyright (C) 2000, 2001, 2002, 2003  James Troup <james@nocrew.org>
-# $Id: heidi,v 1.17 2003-04-15 16:03:31 troup Exp $
+# Copyright (C) 2000, 2001, 2002, 2003, 2004  James Troup <james@nocrew.org>
+# $Id: heidi,v 1.18 2004-03-11 00:20:51 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
                 assoication_id = ql[0][0];
             # Take action
             if action == "add":
-                if assoication_id != None:
+                if assoication_id:
                     utils.warn("'%s~%s~%s' already exists in suite %s." % (package, version, architecture, suite));
                     continue;
                 else:
                 assoication_id = ql[0][0];
             # Take action
             if action == "add":
-                if assoication_id != None:
+                if assoication_id:
                     utils.warn("'%s~%s~%s' already exists in suite %s." % (package, version, architecture, suite));
                     continue;
                 else:
             if not Cnf.has_key("Suite::%s" % (suite)):
                 utils.fubar("Unknown suite '%s'." %(suite));
             else:
-                if action != None:
+                if action:
                     utils.fubar("Can only perform one action at a time.");
                 action = i;
 
 
 
 # Checks Debian packages from Incoming
 # Copyright (C) 2000, 2001, 2002, 2003, 2004  James Troup <james@nocrew.org>
-# $Id: jennifer,v 1.44 2004-02-27 20:07:40 troup Exp $
+# $Id: jennifer,v 1.45 2004-03-11 00:20:51 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
 ################################################################################
 
 # Globals
-jennifer_version = "$Revision: 1.44 $";
+jennifer_version = "$Revision: 1.45 $";
 
 Cnf = None;
 Options = None;
             files[file]["byhand"] = 1;
             files[file]["type"] = "byhand";
         # Checks for a binary package...
-        elif utils.re_isadeb.match(file) != None:
+        elif utils.re_isadeb.match(file):
             has_binaries = 1;
             files[file]["type"] = "deb";
 
                 reject("%s: Depends field is empty." % (file));
 
             # Check the section & priority match those given in the .changes (non-fatal)
-            if control.Find("Section") != None and files[file]["section"] != "" and files[file]["section"] != control.Find("Section"):
+            if control.Find("Section") and files[file]["section"] != "" and files[file]["section"] != control.Find("Section"):
                 reject("%s control file lists section as `%s', but changes file has `%s'." % (file, control.Find("Section", ""), files[file]["section"]), "Warning: ");
-            if control.Find("Priority") != None and files[file]["priority"] != "" and files[file]["priority"] != control.Find("Priority"):
+            if control.Find("Priority") and files[file]["priority"] != "" and files[file]["priority"] != control.Find("Priority"):
                 reject("%s control file lists priority as `%s', but changes file has `%s'." % (file, control.Find("Priority", ""), files[file]["priority"]),"Warning: ");
 
             files[file]["package"] = package;
         # Checks for a source package...
         else:
             m = utils.re_issource.match(file);
-            if m != None:
+            if m:
                 has_source = 1;
                 files[file]["package"] = m.group(1);
                 files[file]["version"] = m.group(2);
 
 #!/usr/bin/env python
 
 # Installs Debian packages from queue/accepted into the pool
-# Copyright (C) 2000, 2001, 2002, 2003  James Troup <james@nocrew.org>
-# $Id: kelly,v 1.13 2003-11-07 01:48:38 troup Exp $
+# Copyright (C) 2000, 2001, 2002, 2003, 2004  James Troup <james@nocrew.org>
+# $Id: kelly,v 1.14 2004-03-11 00:20:51 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
 ###############################################################################
 
 # Globals
-kelly_version = "$Revision: 1.13 $";
+kelly_version = "$Revision: 1.14 $";
 
 Cnf = None;
 Options = None;
     orig_tar_id = Katie.pkg.orig_tar_id;
     orig_tar_location = Katie.pkg.orig_tar_location;
     legacy_source_untouchable = Katie.pkg.legacy_source_untouchable;
-    if orig_tar_id != None and orig_tar_location == "legacy":
+    if orig_tar_id and orig_tar_location == "legacy":
         q = projectB.query("SELECT DISTINCT ON (f.id) l.path, f.filename, f.id as files_id, df.source, df.id as dsc_files_id, f.size, f.md5sum FROM files f, dsc_files df, location l WHERE df.source IN (SELECT source FROM dsc_files WHERE file = %s) AND f.id = df.file AND l.id = f.location AND (l.type = 'legacy' OR l.type = 'legacy-mixed')" % (orig_tar_id));
         qd = q.dictresult();
         for qid in qd:
     # cross-component we need to copy the .orig.tar.gz into the new
     # component too for the same reasons as above.
     #
-    if changes["architecture"].has_key("source") and orig_tar_id != None and \
+    if changes["architecture"].has_key("source") and orig_tar_id and \
        orig_tar_location != "legacy" and orig_tar_location != dsc_location_id:
         q = projectB.query("SELECT l.path, f.filename, f.size, f.md5sum FROM files f, location l WHERE f.id = %s AND f.location = l.id" % (orig_tar_id));
         ql = q.getresult()[0];
     for file in files.keys():
         if files[file]["type"] == "deb":
             new_changelog.write("stable/%s/binary-%s/%s\n" % (files[file]["component"], files[file]["architecture"], file));
-        elif utils.re_issource.match(file) != None:
+        elif utils.re_issource.match(file):
             new_changelog.write("stable/%s/source/%s\n" % (files[file]["component"], file));
         else:
             new_changelog.write("%s\n" % (file));
 
 #!/usr/bin/env python
 
 # Initial setup of an archive
-# Copyright (C) 2002  James Troup <james@nocrew.org>
-# $Id: rose,v 1.3 2003-01-02 18:10:02 troup Exp $
+# Copyright (C) 2002, 2004  James Troup <james@nocrew.org>
+# $Id: rose,v 1.4 2004-03-11 00:20:51 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
     for entry in config.SubTree(tree).List():
         entry = entry.lower();
         if tree == "Dir":
-            if entry == "poolroot" or entry == "queue" or entry == "morguereject":
+            if entry in [ "poolroot", "queue" , "morguereject" ]:
                 continue;
         config_name = "%s::%s" % (tree, entry);
         target = config[config_name];
 
 
 # Utility functions
 # Copyright (C) 2000, 2001, 2002, 2003, 2004  James Troup <james@nocrew.org>
-# $Id: utils.py,v 1.63 2004-02-27 20:07:40 troup Exp $
+# $Id: utils.py,v 1.64 2004-03-11 00:20:51 troup Exp $
 
 ################################################################################
 
     rfc822 = maintainer;
     name = "";
     email = "";
-    if m != None and len(m.groups()) == 2:
+    if m and len(m.groups()) == 2:
         name = m.group(1);
         email = m.group(2);
         if name.find(',') != -1 or name.find('.') != -1: