pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/bulk When generating the report, add a list of top ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/e3bd8d37b73d
branches:  trunk
changeset: 493933:e3bd8d37b73d
user:      jschauma <jschauma%pkgsrc.org@localhost>
date:      Mon May 16 19:11:19 2005 +0000

description:
When generating the report, add a list of top ten offenders at the top.
This makes it easy for people to track down which packages should receive
immediate attention.

diffstat:

 mk/bulk/post-build |  22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diffs (66 lines):

diff -r 9efb8207c018 -r e3bd8d37b73d mk/bulk/post-build
--- a/mk/bulk/post-build        Mon May 16 18:54:06 2005 +0000
+++ b/mk/bulk/post-build        Mon May 16 19:11:19 2005 +0000
@@ -1,5 +1,5 @@
 #!/usr/pkg/bin/perl
-# $NetBSD: post-build,v 1.51 2005/01/15 01:53:00 tv Exp $
+# $NetBSD: post-build,v 1.52 2005/05/16 19:11:19 jschauma Exp $
 #
 # Collect stuff after a pkg bulk build
 #
@@ -241,7 +241,7 @@
                '<td align="right" class="pkg-'.$state_style.'">'.$nbrokenby.'</td>'
                if $nbrokenby > 0;
 
-       if ($pinfo->{nerrors} != 0 && $verbose && $state eq "broken") {
+       if ($pinfo->{nerrors} != 0 && $verbose && ($state eq "broken" || $state eq "topten")) {
                print swrite($report_form, $pkg, $nbrokenby > 0 ? $nbrokenby : "", $maintainer);
        }
 
@@ -450,6 +450,7 @@
 <p>
   Jump to:<br/>
   <ul>
+    <li><a href="#topten">Top Ten Offenders</a></li>
     <li><a href="#broken">Broken packages</a></li>
     <li><a href="#broken depends">Broken dependencies</a></li>
     <li><a href="#not packaged">Not packaged</a></li>
@@ -459,19 +460,20 @@
 EOHTML
 
        my %state_head = (
+               "topten" => "Top Ten Offenders",
                "broken" => "Broken packages",
                "broken depends" => "Broken dependencies",
                "not packaged" => "Not packaged"
        );
 
-       # only include broken packages in the email, see also pkgResult().
-       if ($verbose && scalar(@{$broken->{"broken"}})) {
-               print "\n\n$state_head{broken}\n\n";
+       foreach my $state ("topten", "broken", "broken depends", "not packaged") {
+               next unless scalar(@{$broken->{$state}});
+               
+               if ($verbose && ($state eq "topten" || $state eq "broken")) {
+                       print "\n\n$state_head{$state}\n\n";
                print $report_head;
        }
 
-       foreach my $state ("broken", "broken depends", "not packaged") {
-               next unless scalar(@{$broken->{$state}});
 
                print HTML <<EOHTML;
 
@@ -571,6 +573,12 @@
                $res->{$state} = [ sort { $a->{pkg} cmp $b->{pkg} } @{$res->{$state}} ];
        }
 
+       $res->{"topten"} = [ sort { $b->{nbrokenby} <=> $a->{nbrokenby} } @{$res->{"broken"}} ];
+
+       for (my $count = $#{$res->{"topten"}}; $count >= 10; $count--) {
+               pop(@{$res->{"topten"}});
+       }
+
        return $res;
 }
 



Home | Main Index | Thread Index | Old Index