From 11c6e5fc65f26ba5219997d19707b998a9abf26d Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 7 Mar 2020 22:52:33 +0000 Subject: tl20 perl 5.30.1 for Windows, from Siep git-svn-id: svn://tug.org/texlive/trunk@54166 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/tlperl/lib/App/Cpan.pm | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'Master/tlpkg/tlperl/lib/App') diff --git a/Master/tlpkg/tlperl/lib/App/Cpan.pm b/Master/tlpkg/tlperl/lib/App/Cpan.pm index 87549126dcd..80c3efec433 100644 --- a/Master/tlpkg/tlperl/lib/App/Cpan.pm +++ b/Master/tlpkg/tlperl/lib/App/Cpan.pm @@ -6,7 +6,7 @@ use vars qw($VERSION); use if $] < 5.008 => 'IO::Scalar'; -$VERSION = '1.67'; +$VERSION = '1.672'; =head1 NAME @@ -120,6 +120,8 @@ Load the file that has the CPAN configuration data. This should have the same format as the standard F file, which defines C<$CPAN::Config> as an anonymous hash. +If the file does not exist, C dies. + =item -J Dump the configuration in the same format that CPAN.pm uses. This is useful @@ -261,7 +263,7 @@ to C<1> unless it already has a value (even if that value is false). =item CPAN_OPTS -As with C, a string of additional C options to +As with C, a string of additional C options to add to those you specify on the command line. =item CPANSCRIPT_LOGLEVEL @@ -289,7 +291,7 @@ use CPAN 1.80 (); # needs no test use Config; use autouse Cwd => qw(cwd); use autouse 'Data::Dumper' => qw(Dumper); -use File::Spec::Functions; +use File::Spec::Functions qw(catfile file_name_is_absolute rel2abs); use File::Basename; use Getopt::Std; @@ -1101,12 +1103,14 @@ sub _shell sub _load_config # -j { - my $file = shift || ''; + my $argument = shift; + + my $file = file_name_is_absolute( $argument ) ? $argument : rel2abs( $argument ); + croak( "cpan config file [$file] for -j does not exist!\n" ) unless -e $file; # should I clear out any existing config here? $CPAN::Config = {}; delete $INC{'CPAN/Config.pm'}; - croak( "Config file [$file] does not exist!\n" ) unless -e $file; my $rc = eval "require '$file'"; @@ -1165,9 +1169,9 @@ sub _download $logger->debug( "Inst file would be $path\n" ); - $paths{$arg} = _get_file( _make_path( $path ) ); + $paths{$module} = _get_file( _make_path( $path ) ); - $logger->info( "Downloaded [$arg] to [$paths{$module}]" ); + $logger->info( "Downloaded [$arg] to [$paths{$arg}]" ); } return \%paths; @@ -1191,7 +1195,9 @@ sub _get_file { my $fetch_path = join "/", $site, $path; $logger->debug( "Trying $fetch_path" ); - last if LWP::Simple::getstore( $fetch_path, $store_path ); + my $status_code = LWP::Simple::getstore( $fetch_path, $store_path ); + last if( 200 <= $status_code and $status_code <= 300 ); + $logger->warn( "Could not get [$fetch_path]: Status code $status_code" ); } return $store_path; @@ -1679,13 +1685,15 @@ where this script ends up with a .bat extension David Golden helps integrate this into the C repos. +Jim Keenan fixed up various issues with _download + =head1 AUTHOR brian d foy, C<< >> =head1 COPYRIGHT -Copyright (c) 2001-2015, brian d foy, All Rights Reserved. +Copyright (c) 2001-2018, brian d foy, All Rights Reserved. You may redistribute this under the same terms as Perl itself. -- cgit v1.2.3