| 1 | use strictscip-perl cpan CPAN-Perl-Releases 5.20260820 strict/; |
| 2 | use warningsscip-perl cpan CPAN-Perl-Releases 5.20260820 warnings/; |
| 3 | use File::Specscip-perl cpan CPAN-Perl-Releases 5.20260820 File/Spec/; |
| 4 | use autodiescip-perl cpan CPAN-Perl-Releases 5.20260820 autodie/; |
| 5 | use CPAN::DistnameInfoscip-perl cpan CPAN-Perl-Releases 5.20260820 CPAN/DistnameInfo/; |
| 6 | |
| 7 | my $dir = shiftscip-perl cpan CPAN-Perl-Releases 5.20260820 main/shift(). or diescip-perl cpan CPAN-Perl-Releases 5.20260820 main/die().; |
| 8 | diescip-perl cpan CPAN-Perl-Releases 5.20260820 main/die(). unless -d $dir; |
| 9 | |
| 10 | my %data; |
| 11 | |
| 12 | opendirscip-perl cpan CPAN-Perl-Releases 5.20260820 main/opendir().( my $DIR, $dir ); |
| 13 | |
| 14 | while( my $file = readdirscip-perl cpan CPAN-Perl-Releases 5.20260820 main/readdir(). $DIR ) { |
| 15 | next if $file =~ /^\./ or $file !~ /^perl.+(bz2|gz)$/; |
| 16 | my $abs = File::Spec->catfilescip-perl cpan CPAN-Perl-Releases 5.20260820 File/Spec/catfile().( $dir, $file ); |
| 17 | next unless -l $abs; |
| 18 | my $link = readlinkscip-perl cpan CPAN-Perl-Releases 5.20260820 main/readlink(). $abs; |
| 19 | $link =~ s#^.*/authors/id/##; |
| 20 | my $d = CPAN::DistnameInfo->newscip-perl cpan CPAN-Perl-Releases 5.20260820 CPAN/DistnameInfo/new().( $link ); |
| 21 | $data{ $d->versionscip-perl cpan CPAN-Perl-Releases 5.20260820 CPAN/DistnameInfo/version(). }->{ $d->extensionscip-perl cpan CPAN-Perl-Releases 5.20260820 CPAN/DistnameInfo/extension().} = $link; |
| 22 | } |
| 23 | |
| 24 | my %v = mapscip-perl cpan CPAN-Perl-Releases 5.20260820 main/map(). { |
| 25 | my @v = splitscip-perl cpan CPAN-Perl-Releases 5.20260820 main/split().(qr/[-._]0*/, $_scip-perl cpan CPAN-Perl-Releases 5.20260820 main/$_.); |
| 26 | $v[2] ||= 0; |
| 27 | $v[3] ||= 'Z'; |
| 28 | ($_scip-perl cpan CPAN-Perl-Releases 5.20260820 main/$_. => sprintfscip-perl cpan CPAN-Perl-Releases 5.20260820 main/sprintf(). '%d.%03d%03d-%s', @v) |
| 29 | } keysscip-perl cpan CPAN-Perl-Releases 5.20260820 main/keys(). %data; |
| 30 | |
| 31 | printscip-perl cpan CPAN-Perl-Releases 5.20260820 main/print(). "{\n"; |
| 32 | foreach my $perl ( sortscip-perl cpan CPAN-Perl-Releases 5.20260820 main/sort(). { $v{$ascip-perl cpan CPAN-Perl-Releases 5.20260820 main/$a.} cmp $v{$bscip-perl cpan CPAN-Perl-Releases 5.20260820 main/$b.} } keysscip-perl cpan CPAN-Perl-Releases 5.20260820 main/keys(). %data ) { |
| 33 | printscip-perl cpan CPAN-Perl-Releases 5.20260820 main/print(). qq! "$perl" => {\n!; |
| 34 | printscip-perl cpan CPAN-Perl-Releases 5.20260820 main/print(). qq! "$_" => "!, $data{$perl}->{$_scip-perl cpan CPAN-Perl-Releases 5.20260820 main/$_.}, qq{",\n} |
| 35 | for sortscip-perl cpan CPAN-Perl-Releases 5.20260820 main/sort(). keysscip-perl cpan CPAN-Perl-Releases 5.20260820 main/keys(). %{ $data{$perl} }; |
| 36 | printscip-perl cpan CPAN-Perl-Releases 5.20260820 main/print(). " },\n"; |
| 37 | } |
| 38 | printscip-perl cpan CPAN-Perl-Releases 5.20260820 main/print(). "};\n"; |
| 39 | |
| 40 | exitscip-perl cpan CPAN-Perl-Releases 5.20260820 main/exit(). 0; |