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

[SCM] Debian package checker branch, master, updated. 2.3.0-40-g60d7d91



The following commit has been merged in the master branch:
commit 60d7d91f7707fb6e4046e443f45815c96f79ad1f
Author: Russ Allbery <rra@debian.org>
Date:   Wed Dec 30 19:23:37 2009 -0800

    Sort tags for the maintainer view in the HTML reports
    
    * reporting/html_reports:
      + [RA] Sort the tags so that the maintainer view will group repeated
        instances of the same tag and display extra information in sorted
        order.  (Closes: #563126)

diff --git a/debian/changelog b/debian/changelog
index d15fdb1..7b60038 100755
--- a/debian/changelog
+++ b/debian/changelog
@@ -62,6 +62,10 @@ lintian (2.3.1) UNRELEASED; urgency=low
     + [ADB] Correct the documentation of --tags-from-file to indicate that
       the file contains tags to issue, not suppress.
   
+  * reporting/html_reports:
+    + [RA] Sort the tags so that the maintainer view will group repeated
+      instances of the same tag and display extra information in sorted
+      order.  (Closes: #563126)
   * reporting/templates/maintainer.tmpl:
     + [RA] Fix the logic to optionally display the archive area of
       additional package entries under the same source package.
diff --git a/reporting/html_reports b/reporting/html_reports
index ea2f836..6bb8dce 100755
--- a/reporting/html_reports
+++ b/reporting/html_reports
@@ -211,6 +211,7 @@ while (<>) {
     next unless m/^([EWIXO]): (\S+)(?: (\S+))?: (\S+)(?:\s+(.*))?/;
     my ($code, $package, $type, $tag, $extra) = ($1, $2, $3, $4, $5);
     $type = 'binary' unless (defined $type);
+    $extra = '' unless (defined $extra);
     next unless ($type eq 'source' || $type eq 'binary' || $type eq 'udeb');
 
     # Update statistics.
@@ -362,12 +363,16 @@ for my $maintainer (@maintainers) {
     # Determine if the maintainer's page is clean.  Check all packages for
     # which they're either maintainer or uploader and set $error_clean if
     # they have no errors or warnings.
+    #
+    # Also take this opportunity to sort the tags so that all similar tags
+    # will be grouped, which produces better HTML output.
     my $error_clean = 1;
     for my $source (keys %{ $by_maint{$maintainer} },
                     keys %{ $by_uploader{$maintainer} }) {
         my $versions = $by_maint{$maintainer}{$source}
             || $by_uploader{$maintainer}{$source};
         for my $version (keys %$versions) {
+            $versions->{$version} = [ sort by_tag @{ $versions->{$version} } ];
             my $tags = $versions->{$version};
             for my $tag (@$tags) {
                 $error_clean = 0 if ($tag->{code} eq 'E');
@@ -627,6 +632,17 @@ sub output_template {
     close OUTPUT;
 }
 
+# Sort function for sorting lists of tags.  Sort by package, version, area,
+# type, tag, and then any extra data.  This will produce the best HTML output.
+sub by_tag {
+    return $a->{package} cmp $b->{package}
+        || $a->{version} cmp $b->{version}
+        || $a->{area}    cmp $b->{area}
+        || $a->{type}    cmp $b->{type}
+        || $a->{tag}     cmp $b->{tag}
+        || $a->{extra}   cmp $b->{extra};
+}
+
 # Local Variables:
 # indent-tabs-mode: nil
 # cperl-indent-level: 4

-- 
Debian package checker


Reply to: