X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Flintian.py;fp=daklib%2Flintian.py;h=3d1afc80966c35dfffce6218691a12364b976a74;hb=bebf929c1fb775e07157a0d2f4bbedb82e0eabcc;hp=8e65d3f5db09db29fb928ad5244d0d17900c588d;hpb=d860b7001ae7735b7876fea0680fc6dc407caff4;p=dak.git diff --git a/daklib/lintian.py b/daklib/lintian.py index 8e65d3f5..3d1afc80 100644 --- a/daklib/lintian.py +++ b/daklib/lintian.py @@ -11,7 +11,7 @@ def parse_lintian_output(output): for line in output.split('\n'): m = re_parse_lintian.match(line) if m: - yield m.groups() + yield m.groupdict() def generate_reject_messages(parsed_tags, tag_definitions, log=lambda *args: args): """ @@ -21,36 +21,38 @@ def generate_reject_messages(parsed_tags, tag_definitions, log=lambda *args: arg tags = set() for values in tag_definitions.values(): - for tag in values: - tags.add(tag) + for tag_name in values: + tags.add(tag_name) - for etype, epackage, etag, etext in parsed_tags: - if etag not in tags: + for tag in parsed_tags: + tag_name = tag['tag'] + + if tag_name not in tags: continue # Was tag overridden? - if etype == 'O': + if tag['level'] == 'O': - if etag in tag_definitions['nonfatal']: + if tag_name in tag_definitions['nonfatal']: # Overriding this tag is allowed. pass - elif etag in tag_definitions['fatal']: + elif tag_name in tag_definitions['fatal']: # Overriding this tag is NOT allowed. - log('ftpmaster does not allow tag to be overridable', etag) - yield "%s: Overriden tag %s found, but this tag " \ - "may not be overridden." % (epackage, etag) + log('ftpmaster does not allow tag to be overridable', tag_name) + yield "%(package)s: Overriden tag %(tag)s found, but this " \ + "tag may not be overridden." % tag else: # Tag is known and not overridden; reject - yield "%s: Found lintian output: '%s %s', automatically " \ - "rejected package." % (epackage, etag, etext) + yield "%(package)s: lintian output: '%(tag)s %(description)s', " \ + "automatically rejected package." % tag # Now tell if they *might* override it. - if etag in tag_definitions['nonfatal']: - log("auto rejecting", "overridable", etag) - yield "%s: If you have a good reason, you may override this " \ - "lintian tag." % epackage + if tag_name in tag_definitions['nonfatal']: + log("auto rejecting", "overridable", tag_name) + yield "%(package)s: If you have a good reason, you may " \ + "override this lintian tag." % tag else: - log("auto rejecting", "not overridable", etag) + log("auto rejecting", "not overridable", tag_name)