X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Futils.py;h=2b243b85f9d6e19796dd7ec46e33c7f055cefdc4;hb=c07d8e9ee4c188368fa64dc1f4db0f98d2c9f863;hp=5021483fcb0c901a2154b2a67f8ca7e408f03724;hpb=6fc48cd38c62a3132c8bd2a465d80b0b6fcac74f;p=dak.git diff --git a/daklib/utils.py b/daklib/utils.py index 5021483f..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 +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 @@ -523,7 +526,9 @@ def build_file_list(changes, is_a_dsc=0, field="files", hashname="md5sum"): if not changes.has_key(field): raise NoFilesFieldError - format = SourceFormat.parse_format(changes.get["format"], field, is_a_dsc) + # Get SourceFormat object for this Format and validate it + format = get_format_from_string(changes.get['format']) + format.validate_format(is_a_dsc=is_a_dsc, field=field) includes_section = (not is_a_dsc) and field == "files"