From: James Troup Date: Tue, 14 Oct 2003 19:16:16 +0000 (+0000) Subject: Validate build-depends with apt. X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=62c69fc3bb5fba75bc0ca305ed278246b3c5c974;p=dak.git Validate build-depends with apt. --- diff --git a/jennifer b/jennifer index aac8bba7..13275258 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.38 2003-10-13 00:39:20 troup Exp $ +# $Id: jennifer,v 1.39 2003-10-14 19:16:16 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.38 $"; +jennifer_version = "$Revision: 1.39 $"; Cnf = None; Options = None; @@ -604,10 +604,20 @@ def check_dsc (): if dsc["format"] != "1.0": reject("%s: incompatible 'Format' version produced by a broken version of dpkg-dev 1.9.1{3,4}." % (file)); - # Build-Depends: ARRAY() is not good ... - if (dsc.get("build-depends","").find("ARRAY") == 0 or - dsc.get("build-depends-indep","").find("ARRAY") == 0): - reject("%s: invalid Build-Depends field produced by a broken version of dpkg-dev (1.10.11)" % (file)); + # Validate the build-depends field(s) + for field_name in [ "build-depends", "build-depends-indep" ]: + field = dsc.get(field_name); + if field: + # Check for broken dpkg-dev lossage... + if field.find("ARRAY") == 0: + reject("%s: invalid %s field produced by a broken version of dpkg-dev (1.10.11)" % (file, field_name.title())); + + # Have apt try to parse them... + try: + apt_pkg.ParseSrcDepends(field); + except: + reject("%s: invalid %s field (can not be parsed by apt)." % (file, field_name.title())); + pass; # Ensure the version number in the .dsc matches the version number in the .changes epochless_dsc_version = utils.re_no_epoch.sub('', dsc.get("version"));