X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=jennifer;h=9f98cfb016d3e0504a65a3ee18b9bba1f281fa79;hb=33f1fc6121322c1ace0bdfec4aa55f23770af680;hp=0bec17828e6004c32a72a24ec3098968b9138a5a;hpb=3f9ff6d276ec8dc5fe312a78f3284221979cece9;p=dak.git diff --git a/jennifer b/jennifer index 0bec1782..9f98cfb0 100755 --- a/jennifer +++ b/jennifer @@ -1,8 +1,8 @@ #!/usr/bin/env python # Checks Debian packages from Incoming -# Copyright (C) 2000, 2001, 2002, 2003 James Troup -# $Id: jennifer,v 1.41 2003-10-14 21:52:59 troup Exp $ +# Copyright (C) 2000, 2001, 2002, 2003, 2004 James Troup +# $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 @@ -45,7 +45,7 @@ re_valid_pkg_name = re.compile(r"^[\dA-Za-z][\dA-Za-z\+\-\.]+$"); ################################################################################ # Globals -jennifer_version = "$Revision: 1.41 $"; +jennifer_version = "$Revision: 1.45 $"; Cnf = None; Options = None; @@ -335,7 +335,7 @@ def check_files(): 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"; @@ -388,9 +388,9 @@ def check_files(): 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; @@ -406,11 +406,11 @@ def check_files(): files[file]["source"] = control.Find("Source", files[file]["package"]); # Get the source version source = files[file]["source"]; - source_version = "" + source_version = ""; if source.find("(") != -1: - m = utils.re_extract_src_version.match(source) - source = m.group(1) - source_version = m.group(2) + m = utils.re_extract_src_version.match(source); + source = m.group(1); + source_version = m.group(2); if not source_version: source_version = files[file]["version"]; files[file]["source package"] = source; @@ -456,7 +456,7 @@ def check_files(): # 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); @@ -622,7 +622,7 @@ def check_dsc (): field = dsc.get(field_name); if field: # Check for broken dpkg-dev lossage... - if field.find("ARRAY") == 0: + if field.startswith("ARRAY"): reject("%s: invalid %s field produced by a broken version of dpkg-dev (1.10.11)" % (dsc_filename, field_name.title())); # Have apt try to parse them... @@ -1007,7 +1007,7 @@ def process_it (changes_file): ############################################################################### def main(): - global Cnf, Options, Logger, nmu; + global Cnf, Options, Logger; changes_files = init();