Permalink
Browse files

remove duplicates from noreports pages

  • Loading branch information...
1 parent ac6449c commit aa80f3f8fc183db1e7e2a03c0f5736b85c2d4efb @barbie committed Jun 30, 2017
Showing with 9 additions and 2 deletions.
  1. +2 −0 Changes
  2. +7 −2 lib/CPAN/Testers/WWW/Statistics/Pages.pm
View
@@ -1,6 +1,8 @@
Revision history for CPAN-Testers-WWW-Statistics
================================================
+ - remove duplicates from noreports pages.
+
1.23 2017-06-19
- refactored noreports to use new stats_store table.
- sort by dist name for output of noreport files.
@@ -1183,7 +1183,7 @@ sub _build_noreports {
my @osnames = map { { osname => $_, ostitle => $osnames->{$_} } } sort {$osnames->{$a} cmp $osnames->{$b}} keys %$osnames;
# load all the latest distributions currently on CPAN
- my (@rows,%dists,%osmap);
+ my (@rows,%dists,%osmap,%duplicate);
my $next = $self->{parent}->{CPANSTATS}->iterator('hash',$phrasebook{LATEST});
while(my $row = $next->()) {
next if($noreports && $row->{dist} =~ /^$noreports$/);
@@ -1201,8 +1201,10 @@ sub _build_noreports {
$next = $self->{parent}->{CPANSTATS}->iterator('hash',$phrasebook{NOREPORTS1});
while(my $row = $next->()) {
next unless($dists{$row->{dist}});
+ next if($duplicate{$row->{dist}});
push @rows, $dists{$row->{dist}};
+ $duplicate{$row->{dist}} = 1;
}
# write HTML & CSV files for dists with no reports at all
@@ -1223,10 +1225,13 @@ sub _build_noreports {
# loop for each OS
for my $os (@osnames) {
@rows = ();
+ %duplicate = ();
for my $dist (sort keys %dists) {
- next unless($osmap{$dist}{$os->{osname}});
+ next unless($osmap{$dist}{$os->{osname}});
+ next if($duplicate{$dist});
push @rows, $dists{$dist};
+ $duplicate{$dist} = 1;
}
# write HTML & CSV files for dists without reports for specific OS

0 comments on commit aa80f3f

Please sign in to comment.