Skip to content

Commit 4ccd151

Browse files
jkeenanatoomic
authored andcommitted
1 parent ebfc9d5 commit 4ccd151

File tree

9 files changed

+255
-92
lines changed

9 files changed

+255
-92
lines changed

MANIFEST

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ cpan/CPAN/t/02nox.t See if CPAN::Nox works
323323
cpan/CPAN/t/03pkgs.t See if CPAN::Version works
324324
cpan/CPAN/t/10version.t See if CPAN the module works
325325
cpan/CPAN/t/11mirroredby.t See if CPAN::Mirrored::By works
326+
cpan/CPAN/t/32pushyhttps.t
326327
cpan/CPAN-Meta/corpus/BadMETA.yml
327328
cpan/CPAN-Meta/corpus/bareyaml.meta
328329
cpan/CPAN-Meta/corpus/CL018_yaml.meta

Porting/Maintainers.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ package Maintainers;
250250
},
251251

252252
'CPAN' => {
253-
'DISTRIBUTION' => 'ANDK/CPAN-2.29.tar.gz',
253+
'DISTRIBUTION' => 'ANDK/CPAN-2.33-TRIAL.tar.gz',
254254
'FILES' => q[cpan/CPAN],
255255
'EXCLUDED' => [
256256
qr{^distroprefs/},

cpan/CPAN/lib/App/Cpan.pm

Lines changed: 74 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use vars qw($VERSION);
66

77
use if $] < 5.008 => 'IO::Scalar';
88

9-
$VERSION = '1.676';
9+
$VERSION = '1.678';
1010

1111
=head1 NAME
1212
@@ -244,9 +244,9 @@ The build tools, L<ExtUtils::MakeMaker> and L<Module::Build> use some,
244244
while others matter to the levels above them. Some of these are specified
245245
by the Perl Toolchain Gang:
246246
247-
Lancaster Concensus: L<https://github.com/Perl-Toolchain-Gang/toolchain-site/blob/master/lancaster-consensus.md>
247+
Lancaster Consensus: L<https://github.com/Perl-Toolchain-Gang/toolchain-site/blob/master/lancaster-consensus.md>
248248
249-
Oslo Concensus: L<https://github.com/Perl-Toolchain-Gang/toolchain-site/blob/master/oslo-consensus.md>
249+
Oslo Consensus: L<https://github.com/Perl-Toolchain-Gang/toolchain-site/blob/master/oslo-consensus.md>
250250
251251
=over 4
252252
@@ -347,10 +347,10 @@ sub GOOD_EXIT () { 0 }
347347
# key => [ sub ref, takes args?, exit value, description ]
348348

349349
# options that do their thing first, then exit
350-
h => [ \&_print_help, NO_ARGS, GOOD_EXIT, 'Printing help' ],
351-
v => [ \&_print_version, NO_ARGS, GOOD_EXIT, 'Printing version' ],
352-
V => [ \&_print_details, NO_ARGS, GOOD_EXIT, 'Printing detailed version' ],
353-
X => [ \&_list_all_namespaces, NO_ARGS, GOOD_EXIT, 'Listing all namespaces' ],
350+
h => [ \&_print_help, NO_ARGS, GOOD_EXIT, 'Printing help' ],
351+
v => [ \&_print_version, NO_ARGS, GOOD_EXIT, 'Printing version' ],
352+
V => [ \&_print_details, NO_ARGS, GOOD_EXIT, 'Printing detailed version' ],
353+
X => [ \&_list_all_namespaces, NO_ARGS, GOOD_EXIT, 'Listing all namespaces' ],
354354

355355
# options that affect other options
356356
j => [ \&_load_config, ARGS, GOOD_EXIT, 'Use specified config file' ],
@@ -359,7 +359,7 @@ sub GOOD_EXIT () { 0 }
359359
I => [ \&_load_local_lib, NO_ARGS, GOOD_EXIT, 'Loading local::lib' ],
360360
M => [ \&_use_these_mirrors, ARGS, GOOD_EXIT, 'Setting per session mirrors' ],
361361
P => [ \&_find_good_mirrors, NO_ARGS, GOOD_EXIT, 'Finding good mirrors' ],
362-
w => [ \&_turn_on_warnings, NO_ARGS, GOOD_EXIT, 'Turning on warnings' ],
362+
w => [ \&_turn_on_warnings, NO_ARGS, GOOD_EXIT, 'Turning on warnings' ],
363363

364364
# options that do their one thing
365365
g => [ \&_download, ARGS, GOOD_EXIT, 'Download the latest distro' ],
@@ -377,13 +377,13 @@ sub GOOD_EXIT () { 0 }
377377

378378
r => [ \&_recompile, NO_ARGS, GOOD_EXIT, 'Recompiling' ],
379379
u => [ \&_upgrade, NO_ARGS, GOOD_EXIT, 'Running `make test`' ],
380-
's' => [ \&_shell, NO_ARGS, GOOD_EXIT, 'Running `make test`' ],
380+
's' => [ \&_shell, NO_ARGS, GOOD_EXIT, 'Drop into the CPAN.pm shell' ],
381381

382-
'x' => [ \&_guess_namespace, ARGS, GOOD_EXIT, 'Guessing namespaces' ],
382+
'x' => [ \&_guess_namespace, ARGS, GOOD_EXIT, 'Guessing namespaces' ],
383383
c => [ \&_default, ARGS, GOOD_EXIT, 'Running `make clean`' ],
384384
f => [ \&_default, ARGS, GOOD_EXIT, 'Installing with force' ],
385385
i => [ \&_default, ARGS, GOOD_EXIT, 'Running `make install`' ],
386-
'm' => [ \&_default, ARGS, GOOD_EXIT, 'Running `make`' ],
386+
'm' => [ \&_default, ARGS, GOOD_EXIT, 'Running `make`' ],
387387
t => [ \&_default, ARGS, GOOD_EXIT, 'Running `make test`' ],
388388
T => [ \&_default, ARGS, GOOD_EXIT, 'Installing with notest' ],
389389
);
@@ -483,7 +483,7 @@ sub _setup_environment {
483483
$ENV{PERL_MM_USE_DEFAULT} = 1 unless defined $ENV{PERL_MM_USE_DEFAULT};
484484
}
485485

486-
=item run()
486+
=item run( ARGS )
487487
488488
Just do it.
489489
@@ -496,8 +496,8 @@ my $logger;
496496

497497
sub run
498498
{
499-
my $class = shift;
500-
499+
my( $class, @args ) = @_;
500+
local @ARGV = @args;
501501
my $return_value = HEY_IT_WORKED; # assume that things will work
502502

503503
$logger = $class->_init_logger;
@@ -555,36 +555,36 @@ unless (defined $LL{$LEVEL}){
555555
}
556556
sub new { bless \ my $x, $_[0] }
557557
sub AUTOLOAD {
558-
my $autoload = our $AUTOLOAD;
559-
$autoload =~ s/.*://;
560-
return if $LL{uc $autoload} < $LL{$LEVEL};
561-
$CPAN::Frontend->mywarn(">($autoload): $_\n")
562-
for split /[\r\n]+/, $_[1];
558+
my $autoload = our $AUTOLOAD;
559+
$autoload =~ s/.*://;
560+
return if $LL{uc $autoload} < $LL{$LEVEL};
561+
$CPAN::Frontend->mywarn(">($autoload): $_\n")
562+
for split /[\r\n]+/, $_[1];
563563
}
564564
sub DESTROY { 1 }
565565
}
566566

567567
# load a module without searching the default entry for the current
568568
# directory
569569
sub _safe_load_module {
570-
my $name = shift;
570+
my $name = shift;
571571

572-
local @INC = @INC;
573-
pop @INC if $INC[-1] eq '.';
572+
local @INC = @INC;
573+
pop @INC if $INC[-1] eq '.';
574574

575-
eval "require $name; 1";
575+
eval "require $name; 1";
576576
}
577577

578578
sub _init_logger
579579
{
580580
my $log4perl_loaded = _safe_load_module("Log::Log4perl");
581581

582-
unless( $log4perl_loaded )
583-
{
584-
print STDOUT "Loading internal logger. Log::Log4perl recommended for better logging\n";
585-
$logger = Local::Null::Logger->new;
586-
return $logger;
587-
}
582+
unless( $log4perl_loaded )
583+
{
584+
print STDOUT "Loading internal logger. Log::Log4perl recommended for better logging\n";
585+
$logger = Local::Null::Logger->new;
586+
return $logger;
587+
}
588588

589589
Log::Log4perl::init( \ <<"HERE" );
590590
log4perl.rootLogger=$LEVEL, A1
@@ -730,21 +730,21 @@ sub _get_cpanpm_last_line
730730

731731
my @lines = <$fh>;
732732

733-
# This is a bit ugly. Once we examine a line, we have to
734-
# examine the line before it and go through all of the same
735-
# regexes. I could do something fancy, but this works.
736-
REGEXES: {
733+
# This is a bit ugly. Once we examine a line, we have to
734+
# examine the line before it and go through all of the same
735+
# regexes. I could do something fancy, but this works.
736+
REGEXES: {
737737
foreach my $regex ( @skip_lines )
738738
{
739739
if( $lines[-1] =~ m/$regex/ )
740-
{
741-
pop @lines;
742-
redo REGEXES; # we have to go through all of them for every line!
743-
}
740+
{
741+
pop @lines;
742+
redo REGEXES; # we have to go through all of them for every line!
743+
}
744744
}
745745
}
746746

747-
$logger->debug( "Last interesting line of CPAN.pm output is:\n\t$lines[-1]" );
747+
$logger->debug( "Last interesting line of CPAN.pm output is:\n\t$lines[-1]" );
748748

749749
$lines[-1];
750750
}
@@ -833,15 +833,15 @@ sub _print_details # -V
833833
{
834834
require CPAN::Mirrors;
835835

836-
if ( $CPAN::Config->{connect_to_internet_ok} ) {
837-
$CPAN::Frontend->myprint(qq{Trying to fetch a mirror list from the Internet\n});
838-
eval { CPAN::FTP->localize('MIRRORED.BY',File::Spec->catfile($CPAN::Config->{keep_source_where},'MIRRORED.BY'),3,1) }
839-
or $CPAN::Frontend->mywarn(<<'HERE');
836+
if ( $CPAN::Config->{connect_to_internet_ok} ) {
837+
$CPAN::Frontend->myprint(qq{Trying to fetch a mirror list from the Internet\n});
838+
eval { CPAN::FTP->localize('MIRRORED.BY',File::Spec->catfile($CPAN::Config->{keep_source_where},'MIRRORED.BY'),3,1) }
839+
or $CPAN::Frontend->mywarn(<<'HERE');
840840
We failed to get a copy of the mirror list from the Internet.
841841
You will need to provide CPAN mirror URLs yourself.
842842
HERE
843-
$CPAN::Frontend->myprint("\n");
844-
}
843+
$CPAN::Frontend->myprint("\n");
844+
}
845845

846846
my $mirrors = CPAN::Mirrors->new( _mirror_file() );
847847
my @continents = $mirrors->find_best_continents;
@@ -912,21 +912,21 @@ Stolen from File::Path::Expand
912912

913913
sub _expand_filename
914914
{
915-
my( $path ) = @_;
916-
no warnings 'uninitialized';
917-
$logger->debug( "Expanding path $path\n" );
918-
$path =~ s{\A~([^/]+)?}{
915+
my( $path ) = @_;
916+
no warnings 'uninitialized';
917+
$logger->debug( "Expanding path $path\n" );
918+
$path =~ s{\A~([^/]+)?}{
919919
_home_of( $1 || $> ) || "~$1"
920-
}e;
921-
return $path;
920+
}e;
921+
return $path;
922922
}
923923

924924
sub _home_of
925925
{
926926
require User::pwent;
927-
my( $user ) = @_;
928-
my $ent = User::pwent::getpw($user) or return;
929-
return $ent->dir;
927+
my( $user ) = @_;
928+
my $ent = User::pwent::getpw($user) or return;
929+
return $ent->dir;
930930
}
931931

932932
sub _get_default_inc
@@ -1033,19 +1033,19 @@ sub _get_ping_report
10331033
return -e $url->file;
10341034
}
10351035

1036-
my( $port ) = $url->port;
1036+
my( $port ) = $url->port;
10371037

1038-
return unless $port;
1038+
return unless $port;
10391039

1040-
if ( $ping->can('port_number') ) {
1041-
$ping->port_number($port);
1042-
}
1043-
else {
1044-
$ping->{'port_num'} = $port;
1045-
}
1040+
if ( $ping->can('port_number') ) {
1041+
$ping->port_number($port);
1042+
}
1043+
else {
1044+
$ping->{'port_num'} = $port;
1045+
}
10461046

1047-
$ping->hires(1) if $ping->can( 'hires' );
1048-
my( $alive, $rtt ) = eval{ $ping->ping( $url->host ) };
1047+
$ping->hires(1) if $ping->can( 'hires' );
1048+
my( $alive, $rtt ) = eval{ $ping->ping( $url->host ) };
10491049
$alive ? $rtt : undef;
10501050
}
10511051

@@ -1284,16 +1284,16 @@ sub _get_changes_file
12841284
croak "Reading Changes files requires LWP::Simple and URI\n"
12851285
unless _safe_load_module("LWP::Simple") && _safe_load_module("URI");
12861286

1287-
my $url = shift;
1287+
my $url = shift;
12881288

1289-
my $content = LWP::Simple::get( $url );
1290-
$logger->info( "Got $url ..." ) if defined $content;
1289+
my $content = LWP::Simple::get( $url );
1290+
$logger->info( "Got $url ..." ) if defined $content;
12911291
#print $content;
12921292

12931293
my( $change_link ) = $content =~ m|<a href="(.*?)">Changes</a>|gi;
12941294

12951295
my $changes_url = URI->new_abs( $change_link, $url );
1296-
$logger->debug( "Change link is: $changes_url" );
1296+
$logger->debug( "Change link is: $changes_url" );
12971297

12981298
my $changes = LWP::Simple::get( $changes_url );
12991299

@@ -1373,8 +1373,8 @@ sub _show_out_of_date
13731373

13741374
foreach my $module ( @$modules )
13751375
{
1376-
next unless $module = _expand_module($module);
1377-
next unless $module->inst_file;
1376+
next unless $module = _expand_module($module);
1377+
next unless $module->inst_file;
13781378
next if $module->uptodate;
13791379
printf "%-40s %.4f %.4f\n",
13801380
$module->id,
@@ -1479,7 +1479,7 @@ sub _eval_version
14791479
# split package line to hide from PAUSE
14801480
my $eval = qq{
14811481
package
1482-
ExtUtils::MakeMaker::_version;
1482+
ExtUtils::MakeMaker::_version;
14831483
14841484
local $sigil$var;
14851485
\$$var=undef; do {
@@ -1519,8 +1519,8 @@ sub _expand_module
15191519
my( $module ) = @_;
15201520

15211521
my $expanded = CPAN::Shell->expandany( $module );
1522-
return $expanded if $expanded;
1523-
$expanded = CPAN::Shell->expand( "Module", $module );
1522+
return $expanded if $expanded;
1523+
$expanded = CPAN::Shell->expand( "Module", $module );
15241524
unless( defined $expanded ) {
15251525
$logger->error( "Could not expand [$module]. Check the module name." );
15261526
my $threshold = (
@@ -1689,7 +1689,7 @@ but the canonical source is now in the above repo.
16891689
16901690
Japheth Cleaver added the bits to allow a forced install (C<-f>).
16911691
1692-
Jim Brandt suggest and provided the initial implementation for the
1692+
Jim Brandt suggested and provided the initial implementation for the
16931693
up-to-date and Changes features.
16941694
16951695
Adam Kennedy pointed out that C<exit()> causes problems on Windows
@@ -1705,7 +1705,7 @@ brian d foy, C<< <[email protected]> >>
17051705
17061706
=head1 COPYRIGHT
17071707
1708-
Copyright (c) 2001-2018, brian d foy, All Rights Reserved.
1708+
Copyright (c) 2001-2021, brian d foy, All Rights Reserved.
17091709
17101710
You may redistribute this under the same terms as Perl itself.
17111711

cpan/CPAN/lib/CPAN.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# vim: ts=4 sts=4 sw=4:
33
use strict;
44
package CPAN;
5-
$CPAN::VERSION = '2.29';
5+
$CPAN::VERSION = '2.33';
66
$CPAN::VERSION =~ s/_//;
77

88
# we need to run chdir all over and we would get at wrong libraries

cpan/CPAN/lib/CPAN/Distribution.pm

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use File::Path ();
99
use POSIX ":sys_wait_h";
1010
@CPAN::Distribution::ISA = qw(CPAN::InfoObj);
1111
use vars qw($VERSION);
12-
$VERSION = "2.29";
12+
$VERSION = "2.33";
1313

1414
my $run_allow_installing_within_test = 1; # boolean; either in test or in install, there is no third option
1515

@@ -1445,8 +1445,14 @@ sub verifyCHECKSUM {
14451445
local($") = "/";
14461446
if (my $size = -s $lc_want) {
14471447
$self->debug("lc_want[$lc_want]size[$size]") if $CPAN::DEBUG;
1448-
if ($self->CHECKSUM_check_file($lc_want,1)) {
1449-
return $self->{CHECKSUM_STATUS} = "OK";
1448+
my @stat = stat $lc_want;
1449+
my $epoch_starting_support_of_cpan_path = 1637471530;
1450+
if ($stat[9] >= $epoch_starting_support_of_cpan_path) {
1451+
if ($self->CHECKSUM_check_file($lc_want, 1)) {
1452+
return $self->{CHECKSUM_STATUS} = "OK";
1453+
}
1454+
} else {
1455+
unlink $lc_want;
14501456
}
14511457
}
14521458
$lc_file = CPAN::FTP->localize("authors/id/@local",
@@ -1545,9 +1551,10 @@ sub CHECKSUM_check_file {
15451551
}
15461552
my $tempfile = File::Spec->catfile($tempdir, "CHECKSUMS.$$");
15471553
unlink $tempfile; # ignore missing file
1554+
my $devnull = File::Spec->devnull;
15481555
my $gpg = $CPAN::Config->{gpg} or
15491556
$CPAN::Frontend->mydie("Your configuration suggests that you do not have 'gpg' installed. This is needed to verify checksums with the config variable 'check_sigs' on. Please configure it with 'o conf init gpg'");
1550-
my $system = "gpg --verify --batch --no-tty --output $tempfile $chk_file 2> /dev/null";
1557+
my $system = qq{"$gpg" --verify --batch --no-tty --output "$tempfile" "$chk_file" 2> "$devnull"};
15511558
0 == system $system or $CPAN::Frontend->mydie("gpg run was failing, cannot continue: $system");
15521559
open $fh, $tempfile or $CPAN::Frontend->mydie("Could not open $tempfile: $!");
15531560
local $/;

0 commit comments

Comments
 (0)