summaryrefslogtreecommitdiffstats
path: root/reporting/templates/tag.tmpl
blob: d7c7271e0128ae496f0218580524c28865699811 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
{  # No my/our in front of $q_tag or it will leave scope too soon!
  $q_tag = html_quote($tag);
  head("Lintian Tag: ${q_tag}") }
  <h1><span class="type-{$code}">{$code}</span> {${q_tag}}</h1>

{ if ($statistics{total} <= $shown_count) {
  $OUT .= qq(
  <p>
    All reports of ${tag} for the archive. The extended description of this
    tag is:
  </p>
);
  } else {
  my $log_link = resource_path('lintian.log.gz');
  $OUT .= qq(
    <p>
      A subset of the reports of ${tag} for the archive.  Unfortunately the full
      list is too long, so only ${shown_count} instances are listed on this page.
      At most ${tag_limit_per_package} tags are shown per package.
      <a href="${log_link}">If you need the full list of tags,
       please download the lintian.log.gz file and extract the data you need.</a>
    </p>
    <p>
      The extended description of this tag is:
    </p>
  );
  }
}

  <blockquote class="type-{$code}">
{$description}
  </blockquote>

{
    if ($graphs) {
        my $graph_link = resource_path("${tag}.svg");
        $OUT .= qq(  <p>\n);
        $OUT .= qq(    Evolution of the ${q_tag} Lintian tag over the past\n);
        $OUT .= qq(    $graphs_days days:</p>\n);
        $OUT .= qq(  <div class="graph"><a href="${graph_link}"><img class="graph"\n);
        $OUT .= qq(    src="${graph_link}" alt="The beforementioned graph for the ${q_tag} tag"\n);
        $OUT .= qq(    /></a></div>\n);
    }
    $OUT .= qq(<p>Emitted (non-overridden): $statistics{count}, );
    $OUT .= qq(overridden: $statistics{overrides}, );
    $OUT .= qq(total: $statistics{total}</p>);
}

  <p>
    The package names link to the relevant maintainer page and the
    corresponding report for the source package.  The links go to the full
    maintainer report page, which includes info and experimental tags and
    overridden tags, rather than the default page that shows only errors
    and warnings.
  </p> 
{
    # We get a list of tag data.  We create a separate paragraph for each
    # package name.
    my ($last, $last_pi, $tag, $has_nonoverridden);
    for my $info (sort { $a->{pkg_info}{package} cmp $b->{pkg_info}{package} } @tags) {
        my $pkg_info = $info->{pkg_info};
        if (!$last
            or "$pkg_info->{package} $pkg_info->{type} $pkg_info->{version}" ne "$last_pi->{package} $last_pi->{type} $last_pi->{version}") {
            if ($last) {
                my $overridden = $has_nonoverridden ? '' : qq{ <span class="type-O">overridden</span>};
                $OUT .= qq(  <h2 class="tag"><a href="${path_prefix}full/$last->{pkg_info}{xref}">);
                $OUT .= "$last_pi->{package} $last_pi->{version}</a> ($last_pi->{type}) (<em>$last_pi->{maintainer}</em>)$overridden</em></h2>\n";
                if ($tag) {
                    $OUT .= qq(  <ul class="tag">\n);
                    $OUT .= $tag;
                    $OUT .= "</ul>\n";
                } else {
                    $OUT .= qq(<br class="tag" />\n);
                }
            }
            $last = $info;
            $last_pi = $pkg_info;
            $tag = '';
            $has_nonoverridden = 0;
        }
        $has_nonoverridden = 1 if $info->{code} ne 'O';
        if ($info->{extra}) {
            $tag .= qq{    <li class="type-$info->{code}">};
            $tag .= qq{<span class="type-O">O</span> } if $info->{code} eq 'O';
            $tag .= $info->{extra};
            my @archs = sort keys %{ $info->{archs} };
            $tag .= " <tt>[" . join(', ', @archs) . "]</tt>" if @archs > 1;
            $tag .= "</li>";
        }
    }
    my $overridden = $has_nonoverridden ? '' : qq{ <span class="type-O">overridden</span>};
    $OUT .= qq(  <h2 class="tag"><a href="${path_prefix}full/$last->{pkg_info}{xref}">);
    $OUT .= "$last_pi->{package} $last_pi->{version}</a> ($last_pi->{type}) (<em>$last_pi->{maintainer}</em>)$overridden</h2>\n";
    if ($tag) {
        $OUT .= qq(  <ul class="tag">\n);
        $OUT .= $tag;
        $OUT .= "</ul>\n";
    } else {
        $OUT .= qq(<br class="tag" />\n);
    }
}
{ foot() }