case conflicts still live in 02packages
There are quite a lot of cases in 02packages where package "XYZ" and package "Xyz" are both indexed. I have written a program to classify them into three groups:
- all occur in a dist with a constant name, so the one in the older dist can be dropped
- all occur in dists uploaded by one author, who can then sort things out
- everything else
The third group is larger than I'd like.
use 5.20.0;
use experimental 'postderef';
use Parse::CPAN::Packages::Fast;
my @lines = `gzcat $ENV{HOME}/Sync/minicpan/modules/02packages.details.txt.gz`;
chomp @lines;
shift @lines until $lines[0] =~ /^A/i;
my %seen;
for my $line (@lines) {
next unless length $line;
my ($package, $version, $file) = split /\s+/, $line;
push @{$seen{fc $package}}, [ $package, $file ];
}
my %dist_simplify;
my %author_simplify;
PACKAGE: for my $package (sort { $a cmp $b } keys %seen) {
next if @{ $seen{$package} } == 1;
my %dists;
my %authors;
for my $hunk ($seen{$package}->@*) {
my $dni = CPAN::DistnameInfo->new($hunk->[1]);
$dists{$dni->dist}{ $hunk->[1] } = $dni;
$authors{$dni->cpanid}{ $hunk->[1] } = $dni;
}
if (keys %dists == 1) {
my ($dist, $files) = each %dists;
while (my ($file, $dni) = each %$files) {
$dist_simplify{ $dist }{ $file } = $dni;
}
next PACKAGE;
}
if (keys %authors == 1) {
my ($cpanid, $files) = each %authors;
while (my ($file, $dni) = each %$files) {
$author_simplify{$cpanid}{$package}{$file} = $dni;
}
next PACKAGE;
}
say "$package";
say " @$_" for @{ $seen{$package} };
}
say "-" x 79;
for my $dist (sort { fc $a cmp fc $b } keys %dist_simplify) {
my $files = $dist_simplify{ $dist };
say $dist;
my ($latest) = sort { $b->version cmp $a->version }
values %$files;
say " keep " . $latest->pathname;
say " drop " . $_->pathname
for grep {; $_->version ne $latest->version } values %$files;
}
say "-" x 79;
for my $cpanid (sort keys %author_simplify) {
my $packages = $author_simplify{ $cpanid };
say "$cpanid";
for my $package (sort { fc $a cmp fc $b } keys %$packages) {
say " package $package found in: ",
join q{ }, sort keys $packages->{$package}->%*;
}
}
All of the data is historical. discussion here, maybe: https://github.com/andk/pause/issues/355
As to what to do? Not sure yet!
I'm currently working through these. Out of the 54 instances, 43 are relatively straightforward. I'm gradually emailing all the affected parties, explaining the situation, and offering to do the required actions on their behalf. I've started getting replies. I'll work through these easier cases first.
There are 11 tricky cases (Matt: I previously thought there were 9, but I've reclassified 2 :sad-face:), which I'll move on to once the easy ones are done. I recognise most of these from when we were sorting out permissions clashes.
I appreciate you.
These have now all been resolved / removed.