From 0cd67f3c5de3433fe0deea54fbf3e71e82b4ba6b Mon Sep 17 00:00:00 2001 From: James Troup Date: Tue, 14 Oct 2003 21:52:49 +0000 Subject: [PATCH] Add validate-builddeps check --- tea | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) 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); -- 2.39.5