Added some code to peer into a data structure in Maemian/Schedule.pm. Also added the
[maemian] / nokia-lintian / reporting / templates / maintainer.tmpl
1 { head("Lintian Report for $name", 1) }
2   <h1>{$name}</h1>
3
4   <p>
5     At the time of the last Lintian run, the following possible problems
6     were found in packages maintained by {$maintainer}, listed by source
7     package.
8 {
9     if ($errors) {
10         qq(    See also the <a href="../full/$id">full report</a>, including)
11            . " info, experimental and overridden tags.";
12     } else {
13         qq(    See also the <a href="../maintainer/$id">report showing)
14            . " only errors and warnings</a>.";
15     }
16 }
17     Also see their
18     <a href="http://qa.debian.org/developer.php?login={$email}">QA
19     overview</a>.
20   </p>
21
22 {
23     # Show the summary only if the number of packages is within a certain
24     # range.
25     my $num_packages = keys(%packages) + keys(%uploads);
26     if ($num_packages > 1 and $num_packages < 20) {
27         $OUT .= qq(  <div id="summary">\n    <ul>\n);
28         foreach $source (sort(keys(%packages), keys(%uploads))) {
29             $OUT .= qq(      <li><a href="#$source">$source</a></li>\n);
30         }
31         $OUT .= "    </ul>\n  </div>\n";
32     }
33 }
34   <div class="clear"></div>
35
36 {
37     # We get a hash of package names to a hash of versions to a list of tags.
38     # Create a list with the package information as the title and the tags as
39     # the value.
40     for my $source (sort (keys (%packages), keys (%uploads))) {
41         my ($data, $upload);
42         if ($packages{$source}) {
43             $data = $packages{$source};
44         } else {
45             $data = $uploads{$source};
46             $upload = 1;
47         }
48         for my $version (sort keys %$data) {
49             my $tags = $data->{$version};
50             my $first = 1;
51             my $binary = '';
52             my $tag = '';
53             for my $info (@$tags) {
54                 if ($errors) {
55                     next unless $info->{code} eq 'E' or $info->{code} eq 'W';
56                 }
57
58                 my $is_binary = $info->{type} eq "binary";
59                 my $new_binary = $info->{package} ne $binary if $is_binary;
60
61                 if ($first) {
62                     $OUT .= qq(  <div class="source-header">\n);
63                     $OUT .= qq(   <h2 id="$source">);
64                     $OUT .= "$source ($version)";
65                     $OUT .= " [Uploader]" if $upload;
66                     $OUT .= "</h2>\n";
67                     $OUT .= qq(   <p class="info-links">\n);
68                     $OUT .= qq(    <a href="http://packages.debian.org/src:$source">Info</a>\n);
69                     $OUT .= qq(    <a href="http://packages.qa.debian.org/$source">PTS</a>\n);
70                     $OUT .= qq(    <a href="http://bugs.debian.org/src:$source">Bugs</a>\n);
71                     $OUT .= qq(   </p>\n  </div>\n);
72                     $OUT .= qq(  <ul class="report">\n) unless $is_binary;
73                 }
74
75                 if ($new_binary) {
76                     $OUT .= "</ul>\n    </li>\n  </ul>\n" unless $first;
77                     $OUT .= qq(  <h3>$info->{package}</h3>\n);
78                     $OUT .= qq(  <ul class="report">\n);
79                 }
80
81                 # Display tag name only once.
82                 if ($tag ne $info->{tag} or $new_binary) {
83                     $OUT .= "</ul>\n    </li>\n" unless $first or $new_binary;
84                     $OUT .= "    <li>\n";
85                     $OUT .= qq(      <span class="type-$info->{code}">);
86                     $OUT .= "$info->{code}</span> ";
87                     $OUT .= qq(<a href="../tags/$info->{tag}.html">);
88                     $OUT .= "$info->{tag}</a>\n";
89                     $OUT .= qq(      <ul class="extra">);
90                 }
91
92                 if ($info->{extra}) {
93                     $OUT .= "<li>$info->{extra}</li>";
94                 }
95
96                 $first = 0;
97                 $binary = $info->{package};
98                 $tag = $info->{tag};
99             }
100             $OUT .= "</ul>\n    </li>\n  </ul>\n";
101         }
102     }
103 }
104 { foot() }