From: James Troup Date: Tue, 14 Oct 2003 21:52:49 +0000 (+0000) Subject: Add validate-builddeps check X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=0cd67f3c5de3433fe0deea54fbf3e71e82b4ba6b;p=dak.git Add validate-builddeps check --- diff --git a/tea b/tea index 7a0b4c46..e89a741c 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.24 2003-09-24 00:13:46 troup Exp $ +# $Id: tea,v 1.25 2003-10-14 21:52:49 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 @@ -61,6 +61,7 @@ The following MODEs are available: tar-gz-in-dsc - ensure each .dsc lists a .tar.gz file validate-indices - ensure files mentioned in Packages & Sources exist files-not-symlinks - check files in the database aren't symlinks + validate-builddeps - validate build-dependencies of .dsc files in the archive """ sys.exit(exit_code) @@ -390,6 +391,28 @@ def check_files_not_symlinks(): ################################################################################ +def chk_bd_process_dir (unused, dirname, filenames): + for name in filenames: + if name[-4:] != ".dsc": + continue; + filename = os.path.abspath(dirname+'/'+name); + dsc = utils.parse_changes(filename); + for field_name in [ "build-depends", "build-depends-indep" ]: + field = dsc.get(field_name); + if field: + try: + apt_pkg.ParseSrcDepends(field); + except: + print "E: [%s] %s: %s" % (filename, field_name, field); + pass; + +################################################################################ + +def check_build_depends(): + os.path.walk(Cnf["Dir::Root"], chk_bd_process_dir, None); + +################################################################################ + def main (): global Cnf, projectB, db_files, waste, excluded; @@ -434,6 +457,8 @@ def main (): check_indices_files_exist(); elif mode == "files-not-symlinks": check_files_not_symlinks(); + elif mode == "validate-builddeps": + check_build_depends(); else: utils.warn("unknown mode '%s'" % (mode)); usage(1);