@@ -6,7 +6,7 @@ use vars qw($VERSION);
6
6
7
7
use if $] < 5.008 => ' IO::Scalar' ;
8
8
9
- $VERSION = ' 1.676 ' ;
9
+ $VERSION = ' 1.678 ' ;
10
10
11
11
=head1 NAME
12
12
@@ -244,9 +244,9 @@ The build tools, L<ExtUtils::MakeMaker> and L<Module::Build> use some,
244
244
while others matter to the levels above them. Some of these are specified
245
245
by the Perl Toolchain Gang:
246
246
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>
248
248
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>
250
250
251
251
=over 4
252
252
@@ -347,10 +347,10 @@ sub GOOD_EXIT () { 0 }
347
347
# key => [ sub ref, takes args?, exit value, description ]
348
348
349
349
# 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' ],
354
354
355
355
# options that affect other options
356
356
j => [ \&_load_config, ARGS, GOOD_EXIT, ' Use specified config file' ],
@@ -359,7 +359,7 @@ sub GOOD_EXIT () { 0 }
359
359
I => [ \&_load_local_lib, NO_ARGS, GOOD_EXIT, ' Loading local::lib' ],
360
360
M => [ \&_use_these_mirrors, ARGS, GOOD_EXIT, ' Setting per session mirrors' ],
361
361
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' ],
363
363
364
364
# options that do their one thing
365
365
g => [ \&_download, ARGS, GOOD_EXIT, ' Download the latest distro' ],
@@ -377,13 +377,13 @@ sub GOOD_EXIT () { 0 }
377
377
378
378
r => [ \&_recompile, NO_ARGS, GOOD_EXIT, ' Recompiling' ],
379
379
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 ' ],
381
381
382
- ' x' => [ \&_guess_namespace, ARGS, GOOD_EXIT, ' Guessing namespaces' ],
382
+ ' x' => [ \&_guess_namespace, ARGS, GOOD_EXIT, ' Guessing namespaces' ],
383
383
c => [ \&_default, ARGS, GOOD_EXIT, ' Running `make clean`' ],
384
384
f => [ \&_default, ARGS, GOOD_EXIT, ' Installing with force' ],
385
385
i => [ \&_default, ARGS, GOOD_EXIT, ' Running `make install`' ],
386
- ' m' => [ \&_default, ARGS, GOOD_EXIT, ' Running `make`' ],
386
+ ' m' => [ \&_default, ARGS, GOOD_EXIT, ' Running `make`' ],
387
387
t => [ \&_default, ARGS, GOOD_EXIT, ' Running `make test`' ],
388
388
T => [ \&_default, ARGS, GOOD_EXIT, ' Installing with notest' ],
389
389
);
@@ -483,7 +483,7 @@ sub _setup_environment {
483
483
$ENV {PERL_MM_USE_DEFAULT } = 1 unless defined $ENV {PERL_MM_USE_DEFAULT };
484
484
}
485
485
486
- =item run()
486
+ =item run( ARGS )
487
487
488
488
Just do it.
489
489
@@ -496,8 +496,8 @@ my $logger;
496
496
497
497
sub run
498
498
{
499
- my $class = shift ;
500
-
499
+ my ( $class , @args ) = @_ ;
500
+ local @ARGV = @args ;
501
501
my $return_value = HEY_IT_WORKED; # assume that things will work
502
502
503
503
$logger = $class -> _init_logger;
@@ -555,36 +555,36 @@ unless (defined $LL{$LEVEL}){
555
555
}
556
556
sub new { bless \ my $x , $_ [0] }
557
557
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];
563
563
}
564
564
sub DESTROY { 1 }
565
565
}
566
566
567
567
# load a module without searching the default entry for the current
568
568
# directory
569
569
sub _safe_load_module {
570
- my $name = shift ;
570
+ my $name = shift ;
571
571
572
- local @INC = @INC ;
573
- pop @INC if $INC [-1] eq ' .' ;
572
+ local @INC = @INC ;
573
+ pop @INC if $INC [-1] eq ' .' ;
574
574
575
- eval " require $name ; 1" ;
575
+ eval " require $name ; 1" ;
576
576
}
577
577
578
578
sub _init_logger
579
579
{
580
580
my $log4perl_loaded = _safe_load_module(" Log::Log4perl" );
581
581
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
+ }
588
588
589
589
Log::Log4perl::init( \ <<"HERE" );
590
590
log4perl.rootLogger=$LEVEL , A1
@@ -730,21 +730,21 @@ sub _get_cpanpm_last_line
730
730
731
731
my @lines = <$fh >;
732
732
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: {
737
737
foreach my $regex ( @skip_lines )
738
738
{
739
739
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
+ }
744
744
}
745
745
}
746
746
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]" );
748
748
749
749
$lines [-1];
750
750
}
@@ -833,15 +833,15 @@ sub _print_details # -V
833
833
{
834
834
require CPAN::Mirrors;
835
835
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' );
840
840
We failed to get a copy of the mirror list from the Internet.
841
841
You will need to provide CPAN mirror URLs yourself.
842
842
HERE
843
- $CPAN::Frontend -> myprint(" \n " );
844
- }
843
+ $CPAN::Frontend -> myprint(" \n " );
844
+ }
845
845
846
846
my $mirrors = CPAN::Mirrors-> new( _mirror_file() );
847
847
my @continents = $mirrors -> find_best_continents;
@@ -912,21 +912,21 @@ Stolen from File::Path::Expand
912
912
913
913
sub _expand_filename
914
914
{
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 ~([^/]+)?} {
919
919
_home_of( $1 || $> ) || "~$1 "
920
- } e ;
921
- return $path ;
920
+ } e ;
921
+ return $path ;
922
922
}
923
923
924
924
sub _home_of
925
925
{
926
926
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;
930
930
}
931
931
932
932
sub _get_default_inc
@@ -1033,19 +1033,19 @@ sub _get_ping_report
1033
1033
return -e $url -> file;
1034
1034
}
1035
1035
1036
- my ( $port ) = $url -> port;
1036
+ my ( $port ) = $url -> port;
1037
1037
1038
- return unless $port ;
1038
+ return unless $port ;
1039
1039
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
+ }
1046
1046
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 ) };
1049
1049
$alive ? $rtt : undef ;
1050
1050
}
1051
1051
@@ -1284,16 +1284,16 @@ sub _get_changes_file
1284
1284
croak " Reading Changes files requires LWP::Simple and URI\n "
1285
1285
unless _safe_load_module(" LWP::Simple" ) && _safe_load_module(" URI" );
1286
1286
1287
- my $url = shift ;
1287
+ my $url = shift ;
1288
1288
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 ;
1291
1291
# print $content;
1292
1292
1293
1293
my ( $change_link ) = $content =~ m | <a href="(.*?)">Changes</a>| gi ;
1294
1294
1295
1295
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 " );
1297
1297
1298
1298
my $changes = LWP::Simple::get( $changes_url );
1299
1299
@@ -1373,8 +1373,8 @@ sub _show_out_of_date
1373
1373
1374
1374
foreach my $module ( @$modules )
1375
1375
{
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;
1378
1378
next if $module -> uptodate;
1379
1379
printf " %-40s %.4f %.4f\n " ,
1380
1380
$module -> id,
@@ -1479,7 +1479,7 @@ sub _eval_version
1479
1479
# split package line to hide from PAUSE
1480
1480
my $eval = qq{
1481
1481
package
1482
- ExtUtils::MakeMaker::_version;
1482
+ ExtUtils::MakeMaker::_version;
1483
1483
1484
1484
local $sigil$var ;
1485
1485
\$ $var =undef; do {
@@ -1519,8 +1519,8 @@ sub _expand_module
1519
1519
my ( $module ) = @_ ;
1520
1520
1521
1521
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 );
1524
1524
unless ( defined $expanded ) {
1525
1525
$logger -> error( " Could not expand [$module ]. Check the module name." );
1526
1526
my $threshold = (
@@ -1689,7 +1689,7 @@ but the canonical source is now in the above repo.
1689
1689
1690
1690
Japheth Cleaver added the bits to allow a forced install (C<-f > ).
1691
1691
1692
- Jim Brandt suggest and provided the initial implementation for the
1692
+ Jim Brandt suggested and provided the initial implementation for the
1693
1693
up-to-date and Changes features.
1694
1694
1695
1695
Adam Kennedy pointed out that C<exit() > causes problems on Windows
1705
1705
1706
1706
=head1 COPYRIGHT
1707
1707
1708
- Copyright (c) 2001-2018 , brian d foy, All Rights Reserved.
1708
+ Copyright (c) 2001-2021 , brian d foy, All Rights Reserved.
1709
1709
1710
1710
You may redistribute this under the same terms as Perl itself.
1711
1711
0 commit comments