From ebfcbc52d653737ace24aeac9c01b8faf83151a4 Mon Sep 17 00:00:00 2001 From: Chris Lamb Date: Wed, 28 Oct 2009 13:40:27 +0000 Subject: [PATCH] Port check_dsc_files to use get_format_from_string. Signed-off-by: Chris Lamb --- daklib/utils.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/daklib/utils.py b/daklib/utils.py index 030c1ae6..2b243b85 100755 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -47,7 +47,7 @@ from regexes import re_html_escaping, html_escaping, re_single_line_field, \ re_multi_line_field, re_srchasver, re_taint_free, \ re_gpg_uid, re_re_mark, re_whitespace_comment, re_issource -from srcformats import srcformats, get_format_from_string +from srcformats import get_format_from_string from collections import defaultdict ################################################################################ @@ -416,12 +416,15 @@ def check_dsc_files(dsc_filename, dsc=None, dsc_files=None): rejmsg.append("%s: lists multiple %s" % (dsc_filename, file_type)) # Source format specific tests - for format in srcformats: - if format.re_format.match(dsc['format']): - rejmsg.extend([ - '%s: %s' % (dsc_filename, x) for x in format.reject_msgs(has) - ]) - break + try: + format = get_format_from_string(dsc['format']) + rejmsg.extend([ + '%s: %s' % (dsc_filename, x) for x in format.reject_msgs(has) + ]) + + except UnknownFormatError: + # Not an error here for now + pass return rejmsg -- 2.39.2