diff options
author | Ricardo Signes <rjbs@semiotic.systems> | 2021-06-12 12:21:53 -0400 |
---|---|---|
committer | Ricardo Signes <rjbs@semiotic.systems> | 2021-06-13 09:52:35 -0400 |
commit | 60ab4d25a67394c5b528c239e3dc48ce41bc4f91 (patch) | |
tree | fd76bb1baa0d442fbe6338d71471ef0f8ac088e6 /Porting | |
parent | bc51a73354824f9695c8d108943911bccc6d6c50 (diff) | |
download | perl-60ab4d25a67394c5b528c239e3dc48ce41bc4f91.tar.gz |
CPAN mirror list: stop building one
Diffstat (limited to 'Porting')
-rw-r--r-- | Porting/README.pod | 4 | ||||
-rw-r--r-- | Porting/make_modlib_cpan.pl | 90 |
2 files changed, 0 insertions, 94 deletions
diff --git a/Porting/README.pod b/Porting/README.pod index 27b3d33c6d..5b8038aac1 100644 --- a/Porting/README.pod +++ b/Porting/README.pod @@ -231,10 +231,6 @@ command-line. This script creates F<META.yml> and F<META.json> files. -=head2 F<make_modlib_cpan.pl> - -This script generates the list of registered CPAN sites in F<perlmodlib.PL>. - =head2 F<makerel> This script builds a Perl release tarball. diff --git a/Porting/make_modlib_cpan.pl b/Porting/make_modlib_cpan.pl deleted file mode 100644 index 39f4ff9751..0000000000 --- a/Porting/make_modlib_cpan.pl +++ /dev/null @@ -1,90 +0,0 @@ -#!perl -# -# This program generates the list of registered CPAN sites in perlmodlib.PL -# -use strict; -use warnings; -use 5.14.0; -use autodie; -use HTTP::Tiny; -use JSON::PP; - -$|=1; - -my $http = HTTP::Tiny->new; - -my $url = 'http://www.cpan.org/indices/mirrors.json'; - -my $response = $http->get($url); - -unless ( $response->{success} ) { - die "Error downloading $url"; -} - -die "No content" unless $response->{content}; - -my $json = JSON::PP->new->utf8; -my $mirrors = $json->decode( $response->{content} ); -my %sorted; -my @rsync; - -foreach my $mirror ( sort { $a->{continent} cmp $b->{continent} || $a->{country} cmp $b->{country} } @{ $mirrors } ) { - if ( $mirror->{country} eq 'United States' ) { - push @{ $sorted{ $mirror->{continent} }{ $mirror->{country} }{ $mirror->{region} } }, $mirror; - } - else { - push @{ $sorted{ $mirror->{continent} }{ $mirror->{country} } }, $mirror; - } -} - -say 'Registered CPAN sites'; -say ''; -say '=for maintainers'; -say 'Generated by Porting/make_modlib_cpan.pl'; -say ''; - -foreach my $continent ( sort { $a cmp $b } keys %sorted ) { - say "=head2 $continent"; - say ''; - say '=over 4'; - say ''; - foreach my $country ( sort { $a cmp $b } keys %{ $sorted{ $continent } } ) { - say "=item $country"; - say ''; - if ( $country eq 'United States' ) { - say '=over 8'; - say ''; - foreach my $state ( sort { $a cmp $b } keys %{ $sorted{ $continent }{ $country } } ) { - say "=item $state"; - say ''; - foreach my $mirror ( @{ $sorted{ $continent }{ $country }{ $state } } ) { - say " " . $mirror->{http} if $mirror->{http}; - say " " . $mirror->{ftp} if $mirror->{ftp}; - push @rsync, $mirror->{rsync} if $mirror->{rsync}; - } - say ''; - } - say '=back'; - say ''; - } - else { - foreach my $mirror ( @{ $sorted{ $continent }{ $country } } ) { - say " " . $mirror->{http} if $mirror->{http}; - say " " . $mirror->{ftp} if $mirror->{ftp}; - push @rsync, $mirror->{rsync} if $mirror->{rsync}; - } - say ''; - } - } - say '=back'; - say ''; -} - -say '=head2 RSYNC Mirrors'; -say ''; - -foreach my $rsync ( @rsync ) { - say "\t\t$rsync"; -} - -say ''; |