X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=tea;h=21b6c43f119d6ced51109325d300dd018e11238e;hb=d1bddedc641c0858a64a759ed91748fa2d7e8876;hp=7a0b4c461a56fd78205914e53d5499461a65124c;hpb=d6dd1d07afbec29f2e2a79a27ea147f9c19574fc;p=dak.git diff --git a/tea b/tea index 7a0b4c46..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.24 2003-09-24 00:13:46 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 @@ -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 not name.endswith(".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);