#! /bin/sh /usr/share/dpatch/dpatch-run ## 800-implement-tag-override.dpatch by Eero Häkkinen ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Add support for overriding tag properties. @DPATCH@ diff -urNad lintian-1.23.8~/lib/Tags.pm lintian-1.23.8/lib/Tags.pm --- lintian-1.23.8~/lib/Tags.pm 2006-07-19 12:21:09.000000000 +0000 +++ lintian-1.23.8/lib/Tags.pm 2006-07-19 14:18:46.000000000 +0000 @@ -56,6 +56,7 @@ # - ref: Any references # - experimental: experimental status (possibly undef) my %tags; +my @tag_overrides; # Statistics per file. Key is the filename, value another hash with the # following keys: @@ -94,6 +94,14 @@ return 0; } + foreach my $o (@tag_overrides) { + next unless $newtag->{tag} =~ /^$o->{tag}$/s; + while ( my ($field,$val) = each %$o ) { + next if $field eq 'tag'; + $newtag->{$field} = $val; + } + } + # smooth transition $newtag->{type} = $sev_to_type[$newtag->{severity}] unless $newtag->{type}; @@ -104,6 +113,11 @@ return 1; } +sub add_tag_override { + push @tag_overrides, shift; + return 1; +} + # Add another file, will fail if there is already stored info about # the file sub set_pkg { @@ -157,6 +171,7 @@ undef %stats; undef %info; undef %tags; + undef @tag_overrides; undef $current; return 1; }