From 5f3c900ab8365aba1a7c1661b0f46addd848d7ad Mon Sep 17 00:00:00 2001 From: Mark Hymers Date: Wed, 27 Jul 2011 10:37:51 +0100 Subject: [PATCH] Fix up dsc-syntax check Signed-off-by: Mark Hymers --- dak/check_archive.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dak/check_archive.py b/dak/check_archive.py index 53db5ba7..0d94bbcb 100755 --- a/dak/check_archive.py +++ b/dak/check_archive.py @@ -41,6 +41,7 @@ import apt_inst from daklib.dbconn import * from daklib import utils from daklib.config import Config +from daklib.dak_exceptions import InvalidDscError, ChangesUnicodeError, CantOpenError ################################################################################ @@ -150,16 +151,22 @@ def check_dscs(): count = 0 - for dsc_file in DBConn().session().query(DSCFile): - f = dsc_file.poolfile.fullpath + for src in DBConn().session().query(DBSource).order_by(DBSource.source, DBSource.version): + f = src.poolfile.fullpath try: utils.parse_changes(f, signing_rules=1, dsc_file=1) - except InvalidDscError, line: + except InvalidDscError: utils.warn("syntax error in .dsc file %s" % f) count += 1 except ChangesUnicodeError: utils.warn("found invalid dsc file (%s), not properly utf-8 encoded" % f) count += 1 + except CantOpenError: + utils.warn("missing dsc file (%s)" % f) + count += 1 + except Exception, e: + utils.warn("miscellaneous error parsing dsc file (%s): %s" % (f, str(e))) + count += 1 if count: utils.warn("Found %s invalid .dsc files." % (count)) -- 2.39.5