diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2006-09-13 14:23:38 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2006-09-13 14:23:38 +0000 |
commit | 7fefbd4402375aa51661a98e79d837b4c791b26f (patch) | |
tree | e55a97abb31740ec5f2a2c2f2380a4c4858bb5ec | |
parent | b7f9bbeb27deb5ace5bde1b13a5221532eb90ed0 (diff) | |
download | perl-7fefbd4402375aa51661a98e79d837b4c791b26f.tar.gz |
Upgrade to CPAN 1.87_63
p4raw-id: //depot/perl@28837
-rw-r--r-- | lib/CPAN.pm | 125 | ||||
-rw-r--r-- | lib/CPAN/FirstTime.pm | 9 | ||||
-rw-r--r-- | lib/CPAN/HandleConfig.pm | 10 | ||||
-rw-r--r-- | lib/CPAN/SIGNATURE | 40 |
4 files changed, 116 insertions, 68 deletions
diff --git a/lib/CPAN.pm b/lib/CPAN.pm index 456f2ccbb1..44923db6c7 100644 --- a/lib/CPAN.pm +++ b/lib/CPAN.pm @@ -1,7 +1,7 @@ # -*- Mode: cperl; coding: utf-8; cperl-indent-level: 4 -*- use strict; package CPAN; -$CPAN::VERSION = '1.87_62'; +$CPAN::VERSION = '1.87_63'; $CPAN::VERSION = eval $CPAN::VERSION; use CPAN::HandleConfig; @@ -44,8 +44,13 @@ END { $CPAN::End++; &cleanup; } $CPAN::Signal ||= 0; $CPAN::Frontend ||= "CPAN::Shell"; -@CPAN::Defaultsites = ("http://www.perl.org/CPAN/","ftp://ftp.perl.org/pub/CPAN/") - unless @CPAN::Defaultsites; +unless (@CPAN::Defaultsites){ + @CPAN::Defaultsites = map { + CPAN::URL->new(TEXT => $_, FROM => "DEF") + } + "http://www.perl.org/CPAN/", + "ftp://ftp.perl.org/pub/CPAN/"; +} # $CPAN::iCwd (i for initial) is going to be initialized during find_perl $CPAN::Perl ||= CPAN::find_perl(); $CPAN::Defaultdocs ||= "http://search.cpan.org/perldoc?"; @@ -394,6 +399,27 @@ sub as_string { } } +package CPAN::URL; use overload '""' => "as_string", fallback => 1; +# accessors: TEXT(the url string), FROM(DEF=>defaultlist,USER=>urllist), +# planned are things like age or quality +sub new { + my($class,%args) = @_; + bless { + %args + }, $class; +} +sub as_string { + my($self) = @_; + $self->text; +} +sub text { + my($self,$set) = @_; + if (defined $set) { + $self->{TEXT} = $set; + } + $self->{TEXT}; +} + package CPAN::Distrostatus; use overload '""' => "as_string", fallback => 1; @@ -2846,6 +2872,8 @@ sub localize { } 0..$last; } my(@levels); + $Themethod ||= ""; + $self->debug("Themethod[$Themethod]") if $CPAN::DEBUG; if ($Themethod) { @levels = ($Themethod, grep {$_ ne $Themethod} qw/easy hard hardest/); } else { @@ -2863,7 +2891,12 @@ sub localize { @reordered : 0..$last; # reordered has CDROM up front my @urllist = map { $CPAN::Config->{urllist}[$_] } @host_seq; for my $u (@urllist) { - $u .= "/" unless substr($u,-1) eq "/"; + if ($u->can("text")) { + $u->{TEXT} .= "/" unless substr($u->{TEXT},-1) eq "/"; + } else { + $u .= "/" unless substr($u,-1) eq "/"; + $u = CPAN::URL->new(TEXT => $u, FROM => "USER"); + } } for my $u (@CPAN::Defaultsites) { push @urllist, $u unless grep { $_ eq $u } @urllist; @@ -2956,46 +2989,54 @@ sub hosteasy { } } if ($CPAN::META->has_usable('LWP')) { - $CPAN::Frontend->myprint("Fetching with LWP: + $CPAN::Frontend->myprint("Fetching with LWP: $url "); - unless ($Ua) { - CPAN::LWP::UserAgent->config; - eval { $Ua = CPAN::LWP::UserAgent->new; }; - if ($@) { - $CPAN::Frontend->mywarn("CPAN::LWP::UserAgent->new dies with $@\n"); - } - } - my $res = $Ua->mirror($url, $aslocal); - if ($res->is_success) { - $ThesiteURL = $ro_url; - my $now = time; - utime $now, $now, $aslocal; # download time is more - # important than upload time - return $aslocal; - } elsif ($url !~ /\.gz(?!\n)\Z/) { - my $gzurl = "$url.gz"; - $CPAN::Frontend->myprint("Fetching with LWP: + unless ($Ua) { + CPAN::LWP::UserAgent->config; + eval { $Ua = CPAN::LWP::UserAgent->new; }; + if ($@) { + $CPAN::Frontend->mywarn("CPAN::LWP::UserAgent->new dies with $@\n"); + } + } + my $res = $Ua->mirror($url, $aslocal); + if ($res->is_success) { + $ThesiteURL = $ro_url; + my $now = time; + utime $now, $now, $aslocal; # download time is more + # important than upload + # time + return $aslocal; + } elsif ($url !~ /\.gz(?!\n)\Z/) { + my $gzurl = "$url.gz"; + $CPAN::Frontend->myprint("Fetching with LWP: $gzurl "); - $res = $Ua->mirror($gzurl, "$aslocal.gz"); - if ($res->is_success && - CPAN::Tarzip->new("$aslocal.gz")->gunzip($aslocal) - ) { - $ThesiteURL = $ro_url; - return $aslocal; - } - } else { - $CPAN::Frontend->myprint(sprintf( - "LWP failed with code[%s] message[%s]\n", - $res->code, - $res->message, - )); - # Alan Burlison informed me that in firewall environments - # Net::FTP can still succeed where LWP fails. So we do not - # skip Net::FTP anymore when LWP is available. - } - } else { + $res = $Ua->mirror($gzurl, "$aslocal.gz"); + if ($res->is_success && + CPAN::Tarzip->new("$aslocal.gz")->gunzip($aslocal) + ) { + $ThesiteURL = $ro_url; + return $aslocal; + } + } else { + $CPAN::Frontend->myprint(sprintf( + "LWP failed with code[%s] message[%s]\n", + $res->code, + $res->message, + )); + # Alan Burlison informed me that in firewall environments + # Net::FTP can still succeed where LWP fails. So we do not + # skip Net::FTP anymore when LWP is available. + } + } elsif ( + $ro_url->can("text") + and + $ro_url->{FROM} eq "USER" + ){ + my $ret = $self->hosthard([$ro_url],$file,$aslocal); + return $ret if $ret; + } else { $CPAN::Frontend->mywarn(" LWP not available\n"); } return if $CPAN::Signal; @@ -3750,11 +3791,11 @@ happen.\a $CPAN::Frontend->mysleep(5); } elsif ($line_count != scalar @lines) { - warn sprintf qq{Warning: Your %s + $CPAN::Frontend->mywarn(sprintf qq{Warning: Your %s contains a Line-Count header of %d but I see %d lines there. Please check the validity of the index file by comparing it to more than one CPAN mirror. I'll continue but problems seem likely to happen.\a\n}, -$index_target, $line_count, scalar(@lines); +$index_target, $line_count, scalar(@lines)); } if (not defined $last_updated) { diff --git a/lib/CPAN/FirstTime.pm b/lib/CPAN/FirstTime.pm index 946ca24eec..e12f5e79a5 100644 --- a/lib/CPAN/FirstTime.pm +++ b/lib/CPAN/FirstTime.pm @@ -2,7 +2,7 @@ package CPAN::Mirrored::By; use strict; use vars qw($VERSION); -$VERSION = sprintf "%.6f", substr(q$Rev: 819 $,4)/1000000 + 5.4; +$VERSION = sprintf "%.6f", substr(q$Rev: 825 $,4)/1000000 + 5.4; sub new { my($self,@arg) = @_; @@ -21,7 +21,7 @@ use File::Basename (); use File::Path (); use File::Spec; use vars qw($VERSION $urllist); -$VERSION = sprintf "%.6f", substr(q$Rev: 819 $,4)/1000000 + 5.4; +$VERSION = sprintf "%.6f", substr(q$Rev: 825 $,4)/1000000 + 5.4; =head1 NAME @@ -80,7 +80,7 @@ sub init { my $manual_conf; - local *_real_prompt = \&CPAN::Shell::colorable_makemaker_prompt; + local *_real_prompt; if ( $args{autoconfig} ) { $manual_conf = "no"; } elsif ($matcher) { @@ -847,6 +847,9 @@ sub _strip_spaces { } sub prompt ($;$) { + unless (defined &_real_prompt) { + *_real_prompt = \&CPAN::Shell::colorable_makemaker_prompt; + } my $ans = _real_prompt(@_); _strip_spaces($ans); diff --git a/lib/CPAN/HandleConfig.pm b/lib/CPAN/HandleConfig.pm index 5b3c296757..7c20fb88bf 100644 --- a/lib/CPAN/HandleConfig.pm +++ b/lib/CPAN/HandleConfig.pm @@ -2,7 +2,7 @@ package CPAN::HandleConfig; use strict; use vars qw(%can %keys $VERSION); -$VERSION = sprintf "%.6f", substr(q$Rev: 809 $,4)/1000000 + 5.4; +$VERSION = sprintf "%.6f", substr(q$Rev: 826 $,4)/1000000 + 5.4; %can = ( commit => "Commit changes to disk", @@ -279,6 +279,7 @@ sub defaults { my $done; for my $config (qw(CPAN/MyConfig.pm CPAN/Config.pm)) { CPAN::Shell->reload_this($config) and $done++; + $CPAN::Frontend->myprint("'$config' reread\n"); last if $done; } 1; @@ -461,9 +462,12 @@ the following indispensable but missing parameters: END $args{args} = ["\\b".join("|",@miss)."\\b"]; } - $CPAN::Frontend->myprint(qq{ + if (0) { + # where do we need this? + $CPAN::Frontend->myprint(qq{ $configpm initialized. }); + } CPAN::FirstTime::init($configpm, %args); } @@ -572,7 +576,7 @@ package use strict; use vars qw($AUTOLOAD $VERSION); -$VERSION = sprintf "%.2f", substr(q$Rev: 809 $,4)/100; +$VERSION = sprintf "%.2f", substr(q$Rev: 826 $,4)/100; # formerly CPAN::HandleConfig was known as CPAN::Config sub AUTOLOAD { diff --git a/lib/CPAN/SIGNATURE b/lib/CPAN/SIGNATURE index 6d8837deda..5f7eb1cedf 100644 --- a/lib/CPAN/SIGNATURE +++ b/lib/CPAN/SIGNATURE @@ -1,5 +1,5 @@ This file contains message digests of all files listed in MANIFEST, -signed via the Module::Signature module, version 0.54. +signed via the Module::Signature module, version 0.55. To verify the content in this distribution, first make sure you have Module::Signature installed, then type: @@ -14,25 +14,25 @@ not run its Makefile.PL or Build.PL. -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -SHA1 447d018a706534efcf1e1a435fb0935aae1f6623 ChangeLog +SHA1 c1f086c9206f4729fe7ef7d493505d07bed4fa7a ChangeLog SHA1 9b97524a7a91c815e46b19302a33829d3c26bbbf ChangeLog.old -SHA1 3c9a07074ef95a9778e87a41f9315487c10feeba Changes +SHA1 545b6909636d6adf90bfd162f9bb9732aaf2a0e1 Changes SHA1 a029ffa2f2252bb8914eb658666244710994d256 Changes.old SHA1 4532f91d1cd45d5b948accca01ad7bbf85e84655 MANIFEST SHA1 d6facfb968686d74e249cc1e45463e61ff18d026 MANIFEST.SKIP -SHA1 4f388fc7e356900ed174cd8109b9af920c1e4f5c META.yml -SHA1 4c8e0f9432b5709d9d888685c095fd233fa82962 Makefile.PL +SHA1 719358543d1bf6a168089c5bb24acf703dc1ae6f META.yml +SHA1 984a2dfcaff9e737b974a011e29923bcb43d7181 Makefile.PL SHA1 37e858c51409a297ef5d3fb35dc57cd3b57f9a4d PAUSE2003.pub SHA1 af016003ad503ed078c5f8254521d13a3e0c494f PAUSE2005.pub -SHA1 4895962a895fea47b7dde8b08a1c137199e9b6ee README -SHA1 02b0065d1822dbb2a5d3a546f00c5450fb6cb79b Todo +SHA1 aab32a4021a35d0a293b30477ad83490e3c5c623 README +SHA1 014ca984524ca8966f847551fbf6191407b680da Todo SHA1 efbe8e6882a2caa0d741b113959a706830ab5882 inc/Test/Builder.pm SHA1 ae1d68262bedc2475e2c6fd478d99b259b4fb109 inc/Test/More.pm -SHA1 f74c02ef6e90ef9e057d9c1bb02008821ca1e9fe lib/CPAN.pm +SHA1 d9de09fb815c7edf6358e627c710024e29088c82 lib/CPAN.pm SHA1 94c4656fdae231c673719978e6e9a460f2dfc794 lib/CPAN/Admin.pm SHA1 8884e4b1932555e7d2f52d1df62097e8c78bb548 lib/CPAN/Debug.pm -SHA1 368d73cabcd53fc61f5ad091a0570f49100c934b lib/CPAN/FirstTime.pm -SHA1 8673b5108da6a37a9ebe0b6cc13065b80ed2dcbc lib/CPAN/HandleConfig.pm +SHA1 bb7654424b4fe6739f3abc1d10a10bbd848d0476 lib/CPAN/FirstTime.pm +SHA1 19694adf9394a3462516973d2c77bd2bdff93343 lib/CPAN/HandleConfig.pm SHA1 f7b20d828c197710b4eac3029a30266242fb782b lib/CPAN/Nox.pm SHA1 e7fe16eb17c3a987a7f504deca3f6cca4d5ea4ae lib/CPAN/Tarzip.pm SHA1 4d60b4782a851767c40dc27825057e584014cfc5 lib/CPAN/Version.pm @@ -43,13 +43,13 @@ SHA1 67e80e1cfc3530932de7743dd0c833b2c387609d t/02nox.t SHA1 b586d8e1a613880bbd2ec68d3abd0ca21e43b0c2 t/03pkgs.t SHA1 ebdb653877d5c5e5a071fe9933b18f018cde3250 t/10version.t SHA1 325d8a2f72d59c4cd2400c72403c05cd614c3abc t/11mirroredby.t -SHA1 67e0a678e13fab53fa4441953c0f161add195616 t/12cpan.t -SHA1 228e825e24b1cf3a3ca3fc24f1ea86de354c2cb6 t/30shell.pod -SHA1 a2d61eaa040007d09f198f9b86df63025839567d t/30shell.t +SHA1 7696ade95e8c4943a3e3e6a13c03c450cec8d030 t/12cpan.t +SHA1 fa075e989a5923e73684d13d5e94baa0711bb360 t/30shell.pod +SHA1 bcab03a2c450d4bf3dd104607dc8ed32ff55aa2d t/30shell.t SHA1 6a79f15a10337bd3450604abf39d4462df2a550b t/50pod.t -SHA1 317755a5c56104702a6fd183457afcb3ee7d5251 t/60credentials.t +SHA1 413dd29cf8968e69292a2d652e0e0496a8137a01 t/60credentials.t SHA1 7efe930efd0a07d8101679ed15d4700dcf208137 t/CPAN/CpanTestDummies-1.55.pm -SHA1 f39ccb108dd4fb0e9635b24c09b5a2b299fe77e4 t/CPAN/TestConfig.pm +SHA1 310b5562df76ff28ab05d741e144d84fb5b5369b t/CPAN/TestConfig.pm SHA1 b4fd27234696da334ac6a1716222c70610a98c3a t/CPAN/authors/01mailrc.txt SHA1 61f6dbc7e5616028952b07a0451e029d41993bb6 t/CPAN/authors/id/A/AN/ANDK/CHECKSUMS SHA1 d1a101f24d2d0719c9991df28ede729d58005bb4 t/CPAN/authors/id/A/AN/ANDK/CHECKSUMS@588 @@ -65,11 +65,11 @@ SHA1 1f3304f219bf0da4db6a60f638e11b61c2c2f4c0 t/CPAN/authors/id/A/CHECKSUMS SHA1 dfc900f5bfbc9683fa91977a1c7198222fbd4452 t/CPAN/authors/id/CHECKSUMS SHA1 468603b8016e599fec432e807890fb55f07483a6 t/CPAN/modules/02packages.details.txt SHA1 f4c1a524de16347b37df6427ca01f98dd27f3c81 t/CPAN/modules/03modlist.data -SHA1 8d388a1036ae5e287a2331ce38d65f6b882ed623 t/README.shell.txt +SHA1 7336c3b0b4cd33505e02a11c5a09c3c35fe7bc32 t/README.shell.txt -----BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.3 (GNU/Linux) +Version: GnuPG v1.4.5 (GNU/Linux) -iD8DBQFEy7g57IA58KMXwV0RArlgAJ4q4WAEjyv92NefEikRM5hULGxKHQCfZVjo -Vdq3I7ykecETlhiyH2qR1ao= -=fOLR +iD8DBQFFB5o67IA58KMXwV0RAtSbAKClbKV81vLX1EMW4jB3SmUCP9gcdQCg2t9F +JhIJtTJHV3mhebX2cwJ37gQ= +=3GM3 -----END PGP SIGNATURE----- |