# Various different sanity checks
# Copyright (C) 2000, 2001, 2002, 2003 James Troup <james@nocrew.org>
-# $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
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)
################################################################################
+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;
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);