提交 0cd67f3c 编写于 作者: J James Troup

Add validate-builddeps check

上级 0dfe0a05
......@@ -2,7 +2,7 @@
# 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
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册