21 my @opt = <<'=back' =~ /B<--(\S+)>/g;
25 Only show potential BBCs; The algorithm for recognizing BBCs is that
26 the oldest perl must have 100% success and from there we must face a
27 decline. Problematic are cases where we have decline and improvements
28 mixed in the middle. See also skipmiddle.
34 =item B<--matrixlink!>
36 Add a line to the output with the link to the matrix
40 Disregards all perls lower than that
44 Skip things that have a line in annotated.txt
48 Only pay attention to the minimum perl and the maxium perl. Combined
49 with bbc shows also bbc candidates that had some improvement between
50 the oldest and newest release.
52 =item B<--skipbefore=s>
54 Defaults to C<2006>. If the relase of the distro was before this date
55 (in iso format), then we do not display it in the list.
61 Reading a file written by smokehistory with contents such as
64 - /home/sand/var/ctr/done/archive/S/Spoon/pass.Spoon-0.24.x86_64-linux-ld.2.6.32-5-amd64.1299821028.15026.rpt
65 - /home/sand/var/ctr/done/archive/S/Spoon/pass.Spoon-0.24.x86_64-linux-thread-multi-ld.2.6.32-5-amd64.1295090374.3806.rpt
66 - /home/sand/var/ctr/done/archive/S/Spoon/pass.Spoon-0.24.x86_64-linux-thread-multi.2.6.32-5-amd64.1302363043.25077.rpt
67 - /home/sand/var/ctr/done/archive/S/Spoon/pass.Spoon-0.24.x86_64-linux-thread-multi-ld.2.6.32-5-amd64.1324424772.2901.rpt
69 which means nothing but report files per distro that already represent
70 this filtered set: distro is the most recent one of that distroname
71 (here: Spoon) and has mixed results.
73 Per default we just write summaries to STDOUT like this one:
75 (32) JJORE/Alien-Judy-0.26.tar.gz [20110120T014407Z]:
80 Since the default run spits out >1000 reports we often use the --bbc
81 switch, often combined with --skipmiddle.
91 use lib
"$FindBin::Bin/../lib";
97 use File
::Basename
qw(basename dirname);
98 use File
::Path
qw(mkpath);
102 use Hash
::Util
qw(lock_keys);
106 lock_keys
%Opt, map { /([^=\!]+)/ } @opt;
111 $Opt{skipbefore
} ||= "2006";
114 if ($Opt{skipanno
}) {
115 open my $fh, "annotate.txt" or die;
117 my($dist,$anno) = /^(\S+)\s+(.*)/;
118 $anno{$dist} = $anno;
120 $anno{$dist} = $anno; # prevent DCONWAY/List-Maker-0.003_000.tar.gz to appear
124 my $y = YAML
::Syck
::LoadFile
"bin/smokehistory.pl.yml";
126 VDISTRO
: for my $vdistro (sort keys %$y) { # ACME-Require-Require-v0.0.1
127 if ($Opt{skipanno
} and $anno{$vdistro}) {
130 my $reports = $y->{$vdistro};
133 REPORT
: for my $r (@
$reports) {
134 my($result) = basename
($r) =~ m{(\w+)};
135 open my $fh, $r or die;
138 if (!$canondistro and /^X-Test-Reporter-Distfile:\s*(\S+)/) {
140 } elsif (/^X-Test-Reporter-Perl:\s*(\S+)/) {
141 $v = version
->new($1)->numify;
143 last if $canondistro && $v;
145 if ($Opt{minperl
} && $v < $Opt{minperl
}) {
148 $result{$v}{$result}++;
152 my @v = sort {$a<=>$b} keys %result;
153 if ($Opt{skipmiddle
}) {
156 for my $vi (0..$#v) {
157 my $v = $v[$vi] or next;
158 my $results = $result{$v};
159 for my $r (qw(pass fail)) {
160 $results->{$r} ||= 0;
162 next unless $results->{fail
} + $results->{pass
} > 0;
163 my $fail = $results->{fail
} / ( $results->{fail
} + $results->{pass
} );
167 $bbc = 0 if $fail < $Lfail;
171 next VDISTRO
if $Lfail < 1 || !$bbc;
173 my $isodate = isodate
($canondistro);
174 if (my $skb = $Opt{skipbefore
}) {
175 if ($isodate =~ /^\d/ and $skb gt $isodate) {
180 printf "(%d) %s [%s]:\n", $i, $canondistro, $isodate;
181 if ($Opt{matrixlink
}) {
182 printf "http://matrix.cpantesters.org/?dist=%s\n", $vdistro;
185 my $results = $result{$v};
186 printf "%-12s %s\n", $v, join(":",@
{$results}{qw(pass fail)});
191 my($canondistro) = @_;
192 my $path = sprintf "%s/%s/%s/%s", "/home/ftp/pub/PAUSE/authors/id",
193 substr($canondistro,0,1),
194 substr($canondistro,0,2),
196 my @stat = stat $path or return "N/A";
197 my @date = gmtime $stat[9];
200 sprintf "%04d%02d%02dT%02d%02d%02dZ", @date[5,4,3,2,1,0];
205 # cperl-indent-level: 4