diff options
author | jschauma <jschauma> | 2005-05-16 19:11:19 +0000 |
---|---|---|
committer | jschauma <jschauma> | 2005-05-16 19:11:19 +0000 |
commit | 9313855642757b74ab0f1f3b9e09a19d229ed7f4 (patch) | |
tree | 9c41709e6ab6fb2b198b7f5ed97dd95129fac478 /mk/bulk | |
parent | 021a2e8772161f673258cfc4d2fcacff4d83b85f (diff) | |
download | pkgsrc-9313855642757b74ab0f1f3b9e09a19d229ed7f4.tar.gz |
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 (limited to 'mk/bulk')
-rw-r--r-- | mk/bulk/post-build | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/mk/bulk/post-build b/mk/bulk/post-build index e1738ec3dca..098a4459bf9 100644 --- a/mk/bulk/post-build +++ b/mk/bulk/post-build @@ -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 @@ sub pkgResult ($$) { '<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 @@ tt.filename { <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 @@ tt.filename { 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 @@ sub getBroken { $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; } |