X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Futils.py;h=a6660ae1b9e291f89306dbc4ab1b032a09491ba5;hb=9e0cdd341363ab61ec79f2c5af62007c2af77bcf;hp=030c1ae6857f300aaf27f649c6990455256aab89;hpb=b5c3ede35457e214100e075f95b5118bbc8317a8;p=dak.git diff --git a/daklib/utils.py b/daklib/utils.py index 030c1ae6..a6660ae1 100755 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -47,7 +47,8 @@ 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 formats import parse_format, validate_changes_format +from srcformats import get_format_from_string from collections import defaultdict ################################################################################ @@ -416,12 +417,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,9 +527,9 @@ def build_file_list(changes, is_a_dsc=0, field="files", hashname="md5sum"): if not changes.has_key(field): raise NoFilesFieldError - # 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) + # Validate .changes Format: field + if not is_a_dsc: + validate_changes_format(parse_format(changes['format']), field) includes_section = (not is_a_dsc) and field == "files" @@ -1502,5 +1506,3 @@ apt_pkg.ReadConfigFileISC(Cnf,default_config) if which_conf_file() != default_config: apt_pkg.ReadConfigFileISC(Cnf,which_conf_file()) - -###############################################################################