Upgrade to CPAN.pm 1.94_54
Rafael Garcia-Suarez [Sun, 17 Jan 2010 15:11:42 +0000 (16:11 +0100)]
cpan/CPAN/Changes
cpan/CPAN/Makefile.PL
cpan/CPAN/lib/App/Cpan.pm
cpan/CPAN/lib/CPAN.pm
cpan/CPAN/lib/CPAN/Distribution.pm
cpan/CPAN/lib/CPAN/FTP.pm
cpan/CPAN/lib/CPAN/FirstTime.pm
cpan/CPAN/lib/CPAN/Mirrors.pm
cpan/CPAN/lib/CPAN/Shell.pm

index c6a7771..8433c33 100644 (file)
@@ -1,3 +1,16 @@
+2010-01-14  Andreas J. Koenig  <andk@cpan.org>
+
+       * release 1.94_54
+
+       * David Golden fixes several recent regressions related to external
+       transport tools (ncftp, lynx, curl, etc)
+
+       * fixed quoting for downloading into directories containing
+       whitespace (reported by Jarkko Hietaniemi)
+
+       * amended lib/App/Cpan.pm because of a regression reported by Zefram as
+       rt.cpan.org #53305 and rt.perl.org #71838
+
 2009-12-18  Andreas J. Koenig  <andk@cpan.org>
 
        * release 1.94_53
index 6480c54..741b5c0 100644 (file)
@@ -90,6 +90,7 @@ for my $interesting_module (qw(
         Archive::Tar
         Archive::Zip
         CPAN::Checksums
+        Compress::Bzip2
         Compress::Zlib
         Data::Dumper
         Digest::SHA
@@ -266,11 +267,11 @@ release :: disttest
        git tag -m 'This is $(VERSION)' "$(VERSION)"
        ls -l $(DISTVNAME).tar$(SUFFIX)
        rm -rf $(DISTVNAME)
-       $(NOECHO) $(ECHO) '%   lftp pause.perl.org'
-       $(NOECHO) $(ECHO) '>   cd incoming'
-       $(NOECHO) $(ECHO) '>   put $(DISTVNAME).tar$(SUFFIX)'
-       $(NOECHO) $(ECHO) '>   quit'
-       $(NOECHO) $(ECHO) '%   git push --tags master'
+       $(NOECHO) $(ECHO) '  lftp pause.perl.org'
+       $(NOECHO) $(ECHO) '    cd incoming'
+       $(NOECHO) $(ECHO) '    put $(DISTVNAME).tar$(SUFFIX)'
+       $(NOECHO) $(ECHO) '    quit'
+       $(NOECHO) $(ECHO) '  git push --tags'
 
 snapshot : Makefile no_CR META.yml README testdistros all tardist
 
@@ -362,6 +363,7 @@ testdistros: \
        t/CPAN/authors/id/A/AN/ANDK/CPAN-Test-Dummy-Perl5-Make-Expect-1.00.tar.gz \
        t/CPAN/authors/id/A/AN/ANDK/CPAN-Test-Dummy-Perl5-Make-Failearly-1.02.tar.gz \
        t/CPAN/authors/id/A/AN/ANDK/CPAN-Test-Dummy-Perl5-Make-Features-1.06.tar.gz \
+       t/CPAN/authors/id/A/AN/ANDK/CPAN-Test-Dummy-Perl5-Make-TimeSkew-1.00.tar.gz \
        t/CPAN/authors/id/A/AN/ANDK/CPAN-Test-Dummy-Perl5-Make-UnsatPrereq-1.00.tar.gz \
        t/CPAN/authors/id/A/AN/ANDK/CPAN-Test-Dummy-Perl5-Make-Zip-1.03.zip \
         t/CPAN/authors/id/A/AN/ANDK/NotInChecksums-0.000.tar.gz
@@ -397,6 +399,24 @@ testshell-with-protocol-twice: testdistros
 # testdistros
 #
 
+# TimeSkey has Makefile.PL missing here because it gets the timestamp
+# of the Makefile.PL set to the future which confuses make
+t/CPAN/authors/id/A/AN/ANDK/CPAN-Test-Dummy-Perl5-Make-TimeSkew-1.00.tar.gz: \
+       t/CPAN/authors/id/A/AN/ANDK/CPAN-Test-Dummy-Perl5-Make-TimeSkew/Changes \
+       t/CPAN/authors/id/A/AN/ANDK/CPAN-Test-Dummy-Perl5-Make-TimeSkew/MANIFEST \
+       t/CPAN/authors/id/A/AN/ANDK/CPAN-Test-Dummy-Perl5-Make-TimeSkew/README \
+       t/CPAN/authors/id/A/AN/ANDK/CPAN-Test-Dummy-Perl5-Make-TimeSkew/lib/CPAN/Test/Dummy/Perl5/Make/TimeSkew.pm \
+       t/CPAN/authors/id/A/AN/ANDK/CPAN-Test-Dummy-Perl5-Make-TimeSkew/t/00_load.t
+       -cd t/CPAN/authors/id/A/AN/ANDK/CPAN-Test-Dummy-Perl5-Make-TimeSkew && \
+               $(PERL) -e 'utime((time-12)x2), "Makefile.PL"' && \
+               $(PERL) Makefile.PL && \
+               $(MAKE) dist && \
+               mv CPAN-Test-Dummy-Perl5-Make-TimeSkew-1.00.tar.gz .. && \
+               $(MAKE) tamper-timestamps-now
+       -$(MAKE) clean
+       ls -l $@
+
+
 t/CPAN/authors/id/A/AN/ANDK/CPAN-Test-Dummy-Perl5-Build-1.03.tar.gz: \
        t/CPAN/authors/id/A/AN/ANDK/CPAN-Test-Dummy-Perl5-Build/Changes \
        t/CPAN/authors/id/A/AN/ANDK/CPAN-Test-Dummy-Perl5-Build/MANIFEST \
index e0c6c6c..cfc1290 100644 (file)
@@ -3,7 +3,7 @@ use strict;
 use warnings;
 use vars qw($VERSION);
 
-$VERSION = '1.570001'; # 1.57 + local patches for bleadperl
+$VERSION = '1.5701';
 
 =head1 NAME
 
@@ -314,7 +314,7 @@ sub _process_setup_options
                {
                # this is what CPAN.pm would do otherwise
                CPAN::HandleConfig->load(
-                       be_silent  => 1,
+                       # be_silent  => 1, # candidate to be ripped out forever
                        write_file => 0,
                        );
                }
@@ -477,9 +477,8 @@ sub _default
 
 =for comment
 
-CPAN.pm sends all the good stuff either to STDOUT, or to a temp
-file if $CPAN::Be_Silent is set. I have to intercept that output
-so I can find out what happened.
+CPAN.pm sends all the good stuff either to STDOUT. I have to intercept
+that output so I can find out what happened.
 
 =cut
 
index c5a63e4..cb0b890 100644 (file)
@@ -2,7 +2,7 @@
 # vim: ts=4 sts=4 sw=4:
 use strict;
 package CPAN;
-$CPAN::VERSION = '1.94_5301'; # 1.94_53 + local patches for bleadperl
+$CPAN::VERSION = '1.94_54';
 $CPAN::VERSION =~ s/_//;
 
 # we need to run chdir all over and we would get at wrong libraries
@@ -3112,6 +3112,18 @@ modules in a snapshot bundle file.
 
 =head1 PREREQUISITES
 
+The CPAN program is trying to depend on as little as possible so the
+user can use it in hostile enviroment. It works better the more goodies
+the environment provides. For example if you try in the CPAN shell
+
+  install Bundle::CPAN
+
+or
+
+  install Bundle::CPANxxl
+
+you will find the shell more convenient than the bare shell before.
+
 If you have a local mirror of CPAN and can access all files with
 "file:" URLs, then you only need a perl later than perl5.003 to run
 this module. Otherwise Net::FTP is strongly recommended. LWP may be
@@ -3743,11 +3755,17 @@ See L<http://www.perl.com/perl/misc/Artistic.html>
 
 =head1 TRANSLATIONS
 
-Kawai,Takanori provides a Japanese translation of this manpage at
+Kawai,Takanori provides a Japanese translation of a very old version
+of this manpage at
 L<http://homepage3.nifty.com/hippo2000/perltips/CPAN.htm>
 
 =head1 SEE ALSO
 
-L<cpan>, L<CPAN::Nox>, L<CPAN::Version>
+Many people enter the CPAN shell by running the L<cpan> utility
+program which is installed in the same directory as perl itself. So if
+you have this directory in your PATH variable (or some equivalent in
+your operating system) then typing C<cpan> in a console window will
+work for you as well. Above that the utility provides several
+commandline shortcuts.
 
 =cut
index 6887380..22d3f06 100644 (file)
@@ -819,6 +819,7 @@ sub try_download {
                     $patch = $f if -f $f;
                 }
                 unless (-f $patch) {
+                    CPAN->debug("not on disk: patch[$patch]") if $CPAN::DEBUG;
                     if (my $trydl = $self->try_download($patch)) {
                         $patch = $trydl;
                     } else {
index ed327dc..268ca28 100644 (file)
@@ -739,35 +739,33 @@ sub hostdlhard {
             next DLPRG unless defined $funkyftp;
             next DLPRG if $funkyftp =~ /^\s*$/;
 
-            my($asl_ungz, $asl_gz);
-            ($asl_ungz = $aslocal) =~ s/\.gz//;
-                $asl_gz = "$asl_ungz.gz";
-
             my($src_switch) = "";
             my($chdir) = "";
-            my($stdout_redir) = " > $asl_ungz";
+            my($stdout_redir) = " > \"$aslocal\"";
             if ($f eq "lynx") {
                 $src_switch = " -source";
             } elsif ($f eq "ncftp") {
+                next DLPRG unless $url =~ m{\Aftp://};
                 $src_switch = " -c";
             } elsif ($f eq "wget") {
-                $src_switch = " -O $asl_ungz";
+                $src_switch = " -O \"$aslocal\"";
                 $stdout_redir = "";
             } elsif ($f eq 'curl') {
                 $src_switch = ' -L -f -s -S --netrc-optional';
                 if ($proxy_vars->{http_proxy}) {
                     $src_switch .= qq{ -U "$proxy_vars->{proxy_user}:$proxy_vars->{proxy_pass}" -x "$proxy_vars->{http_proxy}"};
                 }
-            }
-
-            if ($f eq "ncftpget") {
+            } elsif ($f eq "ncftpget") {
+                next DLPRG unless $url =~ m{\Aftp://};
                 $chdir = "cd $aslocal_dir && ";
                 $stdout_redir = "";
             }
             $CPAN::Frontend->myprint(
                                      qq[
-Trying with "$funkyftp$src_switch" to get
-    "$url"
+Trying with
+    $funkyftp$src_switch
+to get
+    $url
 ]);
             my($system) =
                 "$chdir$funkyftp$src_switch \"$url\" $devnull$stdout_redir";
@@ -775,9 +773,9 @@ Trying with "$funkyftp$src_switch" to get
             my($wstatus) = system($system);
             if ($f eq "lynx") {
                 # lynx returns 0 when it fails somewhere
-                if (-s $asl_ungz) {
+                if (-s $aslocal) {
                     my $content = do { local *FH;
-                                       open FH, $asl_ungz or die;
+                                       open FH, $aslocal or die;
                                        local $/;
                                        <FH> };
                     if ($content =~ /^<.*(<title>[45]|Error [45])/si) {
@@ -800,53 +798,9 @@ No success, the file that lynx has downloaded is an empty file.
                 if (-s $aslocal) {
                     # Looks good
                     $some_dl_success++;
-                } elsif ($asl_ungz ne $aslocal) {
-                    # test gzip integrity
-                    if (eval{CPAN::Tarzip->new($asl_ungz)->gtest}) {
-                        # e.g. foo.tar is gzipped --> foo.tar.gz
-                        rename $asl_ungz, $aslocal;
-                        $some_dl_success++;
-                    } else {
-                        eval{CPAN::Tarzip->new($asl_gz)->gzip($asl_ungz)};
-                        if ($@) {
-                            warn "Warning: $@";
-                        } else {
-                            $some_dl_success++;
-                        }
-                    }
                 }
                 $ThesiteURL = $ro_url;
                 return $aslocal;
-            } elsif ($url !~ /\.gz(?!\n)\Z/) {
-                unlink $asl_ungz if
-                    -f $asl_ungz && -s _ == 0;
-                my $gz = "$aslocal.gz";
-                my $gzurl = "$url.gz";
-                $CPAN::Frontend->myprint(
-                                        qq[
-    Trying with "$funkyftp$src_switch" to get
-    "$url.gz"
-    ]);
-                my($system) = "$funkyftp$src_switch \"$url.gz\" $devnull > $asl_gz";
-                $self->debug("system[$system]") if $CPAN::DEBUG;
-                my($wstatus);
-                if (($wstatus = system($system)) == 0
-                    &&
-                    -s $asl_gz
-                ) {
-                    # test gzip integrity
-                    my $ct = eval{CPAN::Tarzip->new($asl_gz)};
-                    if ($ct && $ct->gtest) {
-                        $ct->gunzip($aslocal);
-                    } else {
-                        # somebody uncompressed file for us?
-                        rename $asl_ungz, $aslocal;
-                    }
-                    $ThesiteURL = $ro_url;
-                    return $aslocal;
-                } else {
-                    unlink $asl_gz if -f $asl_gz;
-                }
             } else {
                 my $estatus = $wstatus >> 8;
                 my $size = -f $aslocal ?
@@ -952,6 +906,7 @@ ftp config variable with
              "cd /",
              map("cd $_", split /\//, $dir), # RFC 1738
              "bin",
+             "passive",
              "get $getfile $targetfile",
              "quit"
         );
index ff5b1f8..d1db0cd 100644 (file)
@@ -9,7 +9,7 @@ use File::Path ();
 use File::Spec ();
 use CPAN::Mirrors ();
 use vars qw($VERSION $silent);
-$VERSION = "5.530001"; # 5.53 + local patches for bleadperl
+$VERSION = "5.53";
 
 =head1 NAME
 
index e42680a..1a3402e 100644 (file)
@@ -3,7 +3,7 @@
 package CPAN::Mirrors;
 use strict;
 use vars qw($VERSION $urllist $silent);
-$VERSION = "1.770001"; # 1.77 + local patches for bleadperl
+$VERSION = "1.77";
 
 use Carp;
 use FileHandle;
index 8efea42..8fb5628 100644 (file)
@@ -325,7 +325,14 @@ sub d { $CPAN::Frontend->myprint(shift->format_result('Distribution',@_));}
 #-> sub CPAN::Shell::m ;
 sub m { # emacs confused here }; sub mimimimimi { # emacs in sync here
     my $self = shift;
-    $CPAN::Frontend->myprint($self->format_result('Module',@_));
+    my @m = @_;
+    for (@m) {
+        if (m|(?:\w+/)*\w+\.pm$|) { # same regexp in expandany
+            s/.pm$//;
+            s|/|::|g;
+        }
+    }
+    $CPAN::Frontend->myprint($self->format_result('Module',@m));
 }
 
 #-> sub CPAN::Shell::i ;
@@ -1230,7 +1237,7 @@ sub expandany {
     my($self,$s) = @_;
     CPAN->debug("s[$s]") if $CPAN::DEBUG;
     my $module_as_path = "";
-    if ($s =~ m|(?:\w+/)*\w+\.pm$|) {
+    if ($s =~ m|(?:\w+/)*\w+\.pm$|) { # same regexp in sub m
         $module_as_path = $s;
         $module_as_path =~ s/.pm$//;
         $module_as_path =~ s|/|::|g;