21 my @opt = <<'=back' =~ /B<--(\S+)>/g;
31 Misnomer. We intended to write cronjob but settled with a one-off call
32 for a start. We provide a json file and a txt file.
34 The generation took about 1-2 hours.
36 The text I wrote to p5p after 5.18.1 vs. 5.18.2 RC2 was:
38 Specifically, there was *no* case where 5.18.1 has only passes and
39 5.18.2 has a fail. The following list of 118 distros presents all that
40 have at least one fail in RC2 and at least a pass in 5.18.1.
46 use lib
"$FindBin::Bin/../lib";
52 use File
::Basename
qw(dirname);
53 use File
::Path
qw(mkpath);
59 use Hash
::Util
qw(lock_keys);
62 lock_keys
%Opt, map { /([^=|!]+)/ } @opt;
69 my($perl1,$perl2) = @ARGV;
70 $perl1 = '5.18.1' unless defined $perl1;
71 $perl2 = '5.18.2 RC4' unless defined $perl2;
74 use lib
"$FindBin::Bin/../CPAN-Blame/lib";
75 use CPAN
::Blame
::Config
::Cnntp
;
77 use IPC
::ConcurrencyLimit
;
83 $workdir = File
::Spec
->catdir
84 ($CPAN::Blame
::Config
::Cnntp
::Config
->{solver_vardir
},
87 my($basename) = File
::Basename
::basename
(__FILE__
);
88 my $limit = IPC
::ConcurrencyLimit
->new
91 path
=> "$workdir/IPC-ConcurrencyLimit-$basename",
93 my $limitid = $limit->get_lock;
95 warn "Another process appears to be still running. Exiting.";
99 my $pgdbh = DBI
->connect("dbi:Pg:dbname=analysis") or die "Could not connect to 'analysis': $DBI::err";
101 $pgdbh->do("create temporary table distnames as (select distinct dist, version from cpanstats where perl=? and state='fail') ", undef, $perl2) or die;
102 my $sth1 = $pgdbh->prepare("select dist, version from distnames");
103 my $sth2 = $pgdbh->prepare("select perl, state, count(*) from cpanstats where dist=? and version=? and perl in (?,?) and state in ('pass','fail') group by perl, state");
106 my $jsonxs = JSON
::XS
->new->indent(1);
108 my $ts = POSIX
::strftime
"%FT%T", gmtime($^T
);
113 my $rows = $sth1->rows;
115 while (my($dist,$version) = $sth1->fetchrow_array) {
117 $sth2->execute($dist,$version,$perl1,$perl2);
119 my %seen = (pass
=> 0, fail
=> 0);
120 while (my($perl,$state,$count) = $sth2->fetchrow_array) {
121 $s->{$perl}{$state} = $count;
124 warn "calculated $i/$rows\n";
125 if ($seen{fail
} == 2 and $seen{pass
} == 0) {
128 if ($seen{fail
} == 2 and $seen{pass
} == 2) {
131 store
($dist,$version,$s);
132 warn "wrote $i/$rows\n";
137 my($dist,$version,$s) = @_;
138 $S->{$dist}{$version} = $s;
139 my $outfile = "/home/andreas/var/compare-5181/result-$ts";
141 open my $fh, ">", "$outfile.new" or die;
142 print {$fh} $jsonxs->encode($S);
144 rename "$outfile.new", "$outfile.json" or die "Could not rename: $!";
147 open my $fh, ">", "$outfile.new" or die;
149 for my $k (sort keys %$S){
150 for my $k2 (sort keys %{$S->{$k}}){
151 my $v = $S->{$k}{$k2};
152 no warnings
'uninitialized';
153 printf {$fh} "%3d %-56s %3d %3d %3d %3d\n", ++$i, "$k-$k2", $v->{$perl1}{pass
}, $v->{$perl1}{fail
}, $v->{$perl2}{pass
}, $v->{$perl2}{fail
};
157 rename "$outfile.new", "$outfile.txt" or die "Could not rename: $!";
163 # cperl-indent-level: 4