[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.5.1-151-g31a51f1



The following commit has been merged in the master branch:
commit 31a51f12f06acc7a14c1fb5068246ca082c91e0a
Author: Niels Thykier <niels@thykier.net>
Date:   Tue Jul 26 21:58:32 2011 +0200

    Always produce a tag page, even if it was not emitted
    
    html_reports will now always generate a page for tags, even if
    they were not seen in the log.  The pages will mention that the
    tag was not seen in the run.  There is also a sorted list of all
    tags known to Lintian.
    
    This allows people (and other services) to "blindly" refer to the
    http://lintian.debian.org/tags/$tag.html for a description of the
    tag.

diff --git a/debian/changelog b/debian/changelog
index a61c62f..ec33b68 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -248,6 +248,13 @@ lintian (2.5.2) UNRELEASED; urgency=low
       that these profiles will silently ignore overrides for
       "fatal" (non-overridable) tags.  (Closes: #536364)
 
+  * reporting/{html_reports,templates/index.tmpl}:
+    + [NT] Always emit a page for tags, even if they are not emitted.
+      It will also include a link to the entire list of known tags.
+      (Closes: #631763)
+  * reporting/templates/{tag-not-seen,tags-all}.tmpl:
+    + [NT] New files.
+
   * unpack/list-binpkg:
     + [NT] Added a -u option to make it fetch udebs insteaad of
       regular binaries.  This and the udeb/bin format merge makes
diff --git a/reporting/html_reports b/reporting/html_reports
index 151bffa..1503364 100755
--- a/reporting/html_reports
+++ b/reporting/html_reports
@@ -101,7 +101,7 @@ our $TEMPLATES = "$LINTIAN_ROOT/reporting/templates";
 # templates throughout.
 our %templates;
 for my $template (qw/head foot clean index maintainer maintainers packages tag
-                     tags tags-severity/) {
+                     tags tags-severity tag-not-seen tags-all/) {
     my %options = (TYPE => 'FILE', SOURCE => "$TEMPLATES/$template.tmpl");
     $templates{$template} = Text::Template->new (%options)
         or die "cannot load template $template: $Text::Template::ERROR\n";
@@ -458,19 +458,26 @@ for my $id (keys %clean) {
 
 # Create the pages for each tag.  Each page shows the extended description for
 # the tag and all the packages for which that tag was issued.
-for my $tag (sort keys %by_tag) {
+for my $tag (sort keys %tag_extra) {
     my $info = Lintian::Tag::Info->new($tag);
     next unless $info;
     my $description = $info->description('html', '    ');
     my ($count, $overrides) = (0, 0);
     my %seen_tags;
-    foreach (@{$by_tag{$tag}}) {
-        if ($_->{code} ne 'O') {
-            $count++;
-            $seen_tags{$_->{xref}}++;
-        } else {
-            $overrides++;
+    my $tmpl = 'tag-not-seen';
+    if (exists $by_tag{$tag}) {
+        $tmpl = 'tag';
+        foreach (@{$by_tag{$tag}}) {
+            if ($_->{code} ne 'O') {
+                $count++;
+                $seen_tags{$_->{xref}}++;
+            } else {
+                $overrides++;
+            }
         }
+        $tag_statistics{$tag}{'count'} = $count;
+        $tag_statistics{$tag}{'overrides'} = $overrides;
+        $tag_statistics{$tag}{'packages'} = scalar keys %seen_tags;
     }
 
     my %maint_data = (
@@ -479,20 +486,18 @@ for my $tag (sort keys %by_tag) {
         code        => $info->code,
         tags        => $by_tag{$tag},
     );
-    output_template ("tags/$tag.html", $templates{tag}, \%maint_data);
-
-    $tag_statistics{$tag}{'count'} = $count;
-    $tag_statistics{$tag}{'overrides'} = $overrides;
-    $tag_statistics{$tag}{'packages'} = scalar keys %seen_tags;
+    output_template ("tags/$tag.html", $templates{$tmpl}, \%maint_data);
 }
 
 # Create the general tag indices.
 %data = (
-    tags      => \%by_tag,
-    stats     => \%tag_statistics,
+    tags       => \%by_tag,
+    stats      => \%tag_statistics,
+    all        => \%tag_extra,
 );
 output_template ('tags.html', $templates{tags}, \%data);
 output_template ('tags-severity.html', $templates{'tags-severity'}, \%data);
+output_template ('tags-all.html', $templates{'tags-all'}, \%data);
 
 # Generate the package lists.  These are huge, so we break them into four
 # separate pages.
diff --git a/reporting/templates/index.tmpl b/reporting/templates/index.tmpl
index 12dc24c..163810e 100644
--- a/reporting/templates/index.tmpl
+++ b/reporting/templates/index.tmpl
@@ -27,8 +27,9 @@
 
     <ul>
       <li><a href="maintainers.html">Maintainers</a></li>
-      <li><a href="tags.html">Tags sorted alphabetically</a></li>
-      <li><a href="tags-severity.html">Tags by severity and certainty</a></li>
+      <li><a href="tags.html">Emitted tags sorted alphabetically</a></li>
+      <li><a href="tags-severity.html">Emitted tags by severity and certainty</a></li>
+      <li><a href="tags-all.html">All tags sorted alphabetically</a></li>
       <li>Packages that have names starting with:
         <ul>
           <li><a href="packages_1.html">0-9, A-F</a></li>
diff --git a/reporting/templates/tag-not-seen.tmpl b/reporting/templates/tag-not-seen.tmpl
new file mode 100644
index 0000000..23714fc
--- /dev/null
+++ b/reporting/templates/tag-not-seen.tmpl
@@ -0,0 +1,16 @@
+{ head("Lintian Tag: $tag", 1) }
+  <h1><span class="type-{$code}">{$code}</span> {$tag}</h1>
+
+  <p>
+    All reports of {$tag} for the archive. The extended description of this
+    tag is:
+  </p>
+
+  <blockquote class="type-{$code}">
+{$description}
+  </blockquote>
+
+  <p>
+    This tag has not been emitted in any package tested by Lintian.
+  </p>
+{ foot() }
diff --git a/reporting/templates/tags-all.tmpl b/reporting/templates/tags-all.tmpl
new file mode 100644
index 0000000..ae73094
--- /dev/null
+++ b/reporting/templates/tags-all.tmpl
@@ -0,0 +1,26 @@
+{ head("Lintian Tags") }
+  <h1>Tags</h1>
+
+  <p>
+    This is a list of all tags known to Lintian even the ones
+    not emitted.
+  </p>
+
+  <ul>
+{
+    for my $tag (sort keys %all) {
+        my $text;
+        if ($stats{$tag}) {
+            my $packages = $stats{$tag}{'packages'};
+            my $count = $stats{$tag}{'count'};
+            my $overrides = $stats{$tag}{'overrides'};
+            $text = "$packages packages, $count tags, plus $overrides overrides";
+        } else {
+            $text = 'Not emitted';
+        }
+        $OUT .= qq(    <li><a href="tags/$tag.html">$tag</a>)
+            . " ($text)"
+            . "</li>\n";
+    }
+}  </ul>
+{ foot() }

-- 
Debian package checker


Reply to: