Added some code to peer into a data structure in Maemian/Schedule.pm. Also added the
[maemian] / nokia-lintian / debian / patches / 800-implement-tag-override.dpatch
1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## 800-implement-tag-override.dpatch by Eero Häkkinen <eero.hakkinen@nokia.com>
3 ##
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: Add support for overriding tag properties.
6
7 @DPATCH@
8 diff -urNad lintian-1.23.8~/lib/Tags.pm lintian-1.23.8/lib/Tags.pm
9 --- lintian-1.23.8~/lib/Tags.pm 2006-07-19 12:21:09.000000000 +0000
10 +++ lintian-1.23.8/lib/Tags.pm  2006-07-19 14:18:46.000000000 +0000
11 @@ -56,6 +56,7 @@
12  # - ref: Any references
13  # - experimental: experimental status (possibly undef)
14  my %tags;
15 +my @tag_overrides;
16  
17  # Statistics per file. Key is the filename, value another hash with the
18  # following keys:
19 @@ -94,6 +94,14 @@
20             return 0;
21         }
22  
23 +       foreach my $o (@tag_overrides) {
24 +               next unless $newtag->{tag} =~ /^$o->{tag}$/s;
25 +               while ( my ($field,$val) = each %$o ) {
26 +                       next if $field eq 'tag';
27 +                       $newtag->{$field} = $val;
28 +               }
29 +       }
30 +
31         # smooth transition
32         $newtag->{type} = $sev_to_type[$newtag->{severity}]
33             unless $newtag->{type};
34 @@ -104,6 +113,11 @@
35         return 1;
36  }
37  
38 +sub add_tag_override {
39 +       push @tag_overrides, shift;
40 +       return 1;
41 +}
42 +
43  # Add another file, will fail if there is already stored info about
44  # the file
45  sub set_pkg {
46 @@ -157,6 +171,7 @@
47      undef %stats;
48      undef %info;
49      undef %tags;
50 +    undef @tag_overrides;
51      undef $current;
52      return 1;
53  }