From: James Troup Date: Fri, 17 Oct 2003 11:20:47 +0000 (+0000) Subject: Use .starts/endswith. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dbf02f5cf9161e49abd8b9315e079d927a903a28;p=dak Use .starts/endswith. --- diff --git a/jennifer b/jennifer index 0bec1782..a587a68e 100755 --- a/jennifer +++ b/jennifer @@ -2,7 +2,7 @@ # 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 $ +# $Id: jennifer,v 1.42 2003-10-17 11:20:47 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.42 $"; Cnf = None; Options = None; @@ -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... diff --git a/tea b/tea index e89a741c..21b6c43f 100755 --- a/tea +++ b/tea @@ -2,7 +2,7 @@ # Various different sanity checks # Copyright (C) 2000, 2001, 2002, 2003 James Troup -# $Id: tea,v 1.25 2003-10-14 21:52:49 troup Exp $ +# $Id: tea,v 1.26 2003-10-17 11:20:47 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 @@ -393,7 +393,7 @@ def check_files_not_symlinks(): def chk_bd_process_dir (unused, dirname, filenames): for name in filenames: - if name[-4:] != ".dsc": + if not name.endswith(".dsc"): continue; filename = os.path.abspath(dirname+'/'+name); dsc = utils.parse_changes(filename);