From: Andreas König Date: Wed, 15 Feb 2006 09:19:56 +0000 (+0100) Subject: [PAUSE] CPAN Upload: A/AN/ANDK/CPAN-1.84.tar.gz X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4d1321a770b2c1abed6424883ec43f5450b88465;p=p5sagit%2Fp5-mst-13.2.git [PAUSE] CPAN Upload: A/AN/ANDK/CPAN-1.84.tar.gz Message-ID: <87oe19owyb.fsf@k75.linux.bogus> p4raw-id: //depot/perl@27192 --- diff --git a/MANIFEST b/MANIFEST index 6b8763f..bdb85d5 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1494,11 +1494,11 @@ lib/CPAN/PAUSE2005.pub CPAN public key lib/CPAN.pm Interface to Comprehensive Perl Archive Network lib/CPAN/SIGNATURE CPAN public key lib/CPAN/Tarzip.pm helper package for CPAN.pm -lib/CPAN/t/loadme.t See if CPAN the module works -lib/CPAN/t/mirroredby.t See if CPAN::Mirrored::By works -lib/CPAN/t/Nox.t See if CPAN::Nox works -lib/CPAN/t/vcmp.t See if CPAN the module works -lib/CPAN/t/version.t See if CPAN::Version works +lib/CPAN/t/01loadme.t See if CPAN the module works +lib/CPAN/t/02nox.t See if CPAN::Nox works +lib/CPAN/t/03pkgs.t See if CPAN::Version works +lib/CPAN/t/10version.t See if CPAN the module works +lib/CPAN/t/11mirroredby.t See if CPAN::Mirrored::By works lib/CPAN/Version.pm Simple math with different flavors of version strings lib/ctime.pl A ctime workalike lib/Cwd.pm Various cwd routines (getcwd, fastcwd, chdir) diff --git a/lib/CPAN.pm b/lib/CPAN.pm index 77fe51c..ca4715d 100644 --- a/lib/CPAN.pm +++ b/lib/CPAN.pm @@ -1,6 +1,6 @@ # -*- Mode: cperl; coding: utf-8; cperl-indent-level: 4 -*- package CPAN; -$VERSION = '1.83_64'; +$VERSION = '1.84'; $VERSION = eval $VERSION; use strict; @@ -19,7 +19,6 @@ use File::Copy (); use File::Find; use File::Path (); use File::Spec (); -use File::Temp (); use FileHandle (); use Safe (); use Sys::Hostname qw(hostname); @@ -145,7 +144,11 @@ sub shell { # no strict; # I do not recall why no strict was here (2000-09-03) $META->checklock(); - my @cwd = (CPAN::anycwd(),File::Spec->tmpdir(),File::Spec->rootdir()); + my @cwd = ( + CPAN::anycwd(), + File::Spec->can("tmpdir") ? File::Spec->tmpdir() : (), + File::Spec->rootdir(), + ); my $try_detect_readline; $try_detect_readline = $term->ReadLine eq "Term::ReadLine::Stub" if $term; my $rl_avail = $Suppress_readline ? "suppressed" : @@ -348,7 +351,8 @@ sub as_string { } package CPAN::Prompt; use overload '""' => "as_string"; -our $prompt = "cpan> "; +use vars qw($prompt); +$prompt = "cpan> "; $CPAN::CurrentCommandId ||= 0; sub as_randomly_capitalized_string { # pure fun variant @@ -390,11 +394,7 @@ sub text { } sub as_string { my($self) = @_; - if (0) { # called from rematein during install? - require Carp; - Carp::cluck("HERE"); - } - $self->{TEXT}; + $self->text; } package CPAN::Shell; @@ -862,11 +862,12 @@ sub has_inst { my($self,$mod,$message) = @_; Carp::croak("CPAN->has_inst() called without an argument") unless defined $mod; - if (defined $message && $message eq "no" + my %dont = map { $_ => 1 } keys %{$CPAN::META->{dontload_hash}||{}}, + keys %{$CPAN::Config->{dontload_hash}||{}}, + @{$CPAN::Config->{dontload_list}||[]}; + if (defined $message && $message eq "no" # afair only used by Nox || - exists $CPAN::META->{dontload_hash}{$mod} # unsafe meta access, ok - || - exists $CPAN::Config->{dontload_hash}{$mod} + $dont{$mod} ) { $CPAN::META->{dontload_hash}{$mod}||=1; # unsafe meta access, ok return 0; @@ -902,12 +903,17 @@ sub has_inst { }) unless $Have_warned->{"Net::FTP"}++; sleep 3; } elsif ($mod eq "Digest::SHA"){ - $CPAN::Frontend->myprint(qq{ + if ($Have_warned->{"Digest::SHA"}++) { + $CPAN::Frontend->myprint(qq{CPAN: checksum security checks disabled}. + qq{because Digest::SHA not installed.\n}); + } else { + $CPAN::Frontend->myprint(qq{ CPAN: checksum security checks disabled because Digest::SHA not installed. Please consider installing the Digest::SHA module. }); - sleep 2; + sleep 2; + } } elsif ($mod eq "Module::Signature"){ unless ($Have_warned->{"Module::Signature"}++) { # No point in complaining unless the user can @@ -1394,7 +1400,6 @@ sub o { $o_type ||= ""; CPAN->debug("o_type[$o_type] o_what[".join(" | ",@o_what)."]\n"); if ($o_type eq 'conf') { - shift @o_what if @o_what && $o_what[0] eq 'help'; if (!@o_what) { # print all things, "o conf" my($k,$v); $CPAN::Frontend->myprint("CPAN::Config options"); @@ -1753,7 +1758,13 @@ sub failed { my @failed; DIST: for my $d ($CPAN::META->all_objects("CPAN::Distribution")) { my $failed = ""; - for my $nosayer (qw(signature_verify make make_test install)) { + for my $nosayer ( + "writemakefile", + "signature_verify", + "make", + "make_test", + "install", + ) { next unless exists $d->{$nosayer}; next unless ( $d->{$nosayer}->can("failed") ? @@ -2031,11 +2042,14 @@ sub format_result { sub report_fh { return $installation_report_fh if $installation_report_fh; - $installation_report_fh = File::Temp->new( - template => 'cpan_install_XXXX', - suffix => '.txt', - unlink => 0, - ); + if ($CPAN::META->has_inst("File::Temp")) { + $installation_report_fh + = File::Temp->new( + template => 'cpan_install_XXXX', + suffix => '.txt', + unlink => 0, + ); + } unless ( $installation_report_fh ) { warn("Couldn't open installation report file; " . "no report file will be generated." @@ -2111,11 +2125,11 @@ sub mywarn { $self->print_ornamented($what, 'bold red on_yellow'); } -sub myconfess { - my($self,$what) = @_; - $self->print_ornamented($what, 'bold red on_white'); - Carp::confess "died"; -} +#sub myconfess { +# my($self,$what) = @_; +# $self->print_ornamented($what, 'bold red on_white'); +# Carp::confess "died"; +#} sub mydie { my($self,$what) = @_; @@ -2592,7 +2606,9 @@ sub localize { } @levels = qw/easy/ if $^O eq 'MacOS'; my($levelno); - local $ENV{FTP_PASSIVE} = $CPAN::Config->{ftp_passive} if exists $CPAN::Config->{ftp_passive}; + local $ENV{FTP_PASSIVE} = + exists $CPAN::Config->{ftp_passive} ? + $CPAN::Config->{ftp_passive} : 1; for $levelno (0..$#levels) { my $level = $levels[$levelno]; my $method = "host$level"; @@ -2661,13 +2677,21 @@ sub hosteasy { $l =~ s|^file:||; # assume they # meant # file://localhost - $l =~ s|^/||s unless -f $l; # e.g. /P: - $self->debug("without URI::URL we try local file $l") if $CPAN::DEBUG; + $l =~ s|^/||s + if ! -f $l && $l =~ m|^/\w:|; # e.g. /P: } + $self->debug("local file[$l]") if $CPAN::DEBUG; if ( -f $l && -r _) { $ThesiteURL = $ro_url; return $l; } + if ($l =~ /(.+)\.gz$/) { + my $ungz = $1; + if ( -f $ungz && -r _) { + $ThesiteURL = $ro_url; + return $ungz; + } + } # Maybe mirror has compressed it? if (-f "$l.gz") { $self->debug("found compressed $l.gz") if $CPAN::DEBUG; @@ -2830,7 +2854,7 @@ Trying with "$funkyftp$src_switch" to get if ($f eq "lynx") { # lynx returns 0 when it fails somewhere if (-s $asl_ungz) { - my $content = do { open my $fh, $asl_ungz or die; local $/; <$fh> }; + my $content = do { local *FH; open FH, $asl_ungz or die; local $/; }; if ($content =~ /^<.*[45]/si) { $CPAN::Frontend->myprint(qq{ No success, the file that lynx has has downloaded looks like an error message: @@ -3829,12 +3853,16 @@ sub as_string { my $class = ref($self); $class =~ s/^CPAN:://; push @m, $class, " id = $self->{ID}\n"; - my $ro = $self->ro; + my $ro; + unless ($ro = $self->ro) { + $CPAN::Frontend->mydie("Unknown distribution $self->{ID}"); + } for (sort keys %$ro) { # next if m/^(ID|RO)$/; my $extra = ""; if ($_ eq "CPAN_USERID") { - $extra .= " (".$self->author; + $extra .= " ("; + $extra .= $self->fullname; my $email; # old perls! if ($email = $CPAN::META->instance("CPAN::Author", $self->cpan_userid @@ -3859,7 +3887,7 @@ sub as_string { push @m, sprintf( " %-12s %s\n", $_, - join(" ",keys %{$self->{$_}}), + join(" ",sort keys %{$self->{$_}}), ); } else { push @m, sprintf " %-12s %s\n", $_, $self->{$_}; @@ -3868,8 +3896,8 @@ sub as_string { join "", @m, "\n"; } -#-> sub CPAN::InfoObj::author ; -sub author { +#-> sub CPAN::InfoObj::fullname ; +sub fullname { my($self) = @_; $CPAN::META->instance("CPAN::Author",$self->cpan_userid)->fullname; } @@ -3878,6 +3906,8 @@ sub author { sub dump { my($self) = @_; require Data::Dumper; + local $Data::Dumper::Sortkeys; + $Data::Dumper::Sortkeys = 1; print Data::Dumper::Dumper($self); } @@ -3952,8 +3982,12 @@ sub ls { } @dl = $self->dir_listing([@csf,"CHECKSUMS"], 1, 1); if ($glob) { - my $rglob = Text::Glob::glob_to_regex($glob); - @dl = grep { $_->[2] =~ /$rglob/ } @dl; + if ($CPAN::META->has_inst("Text::Glob")) { + my $rglob = Text::Glob::glob_to_regex($glob); + @dl = grep { $_->[2] =~ /$rglob/ } @dl; + } else { + $CPAN::Frontend->mydie("Text::Glob not installed, cannot proceed"); + } } $CPAN::Frontend->myprint(join "", map { sprintf("%8d %10s %s/%s\n", $_->[0], $_->[1], $id, $_->[2]) @@ -4094,6 +4128,44 @@ sub normalize { $s; } +#-> sub CPAN::Distribution::author ; +sub author { + my($self) = @_; + my($authorid) = $self->pretty_id =~ /^([\w\-]+)/; + CPAN::Shell->expand("Author",$authorid); +} + +# tries to get the yaml from CPAN instead of the distro itself: +# EXPERIMENTAL, UNDOCUMENTED AND UNTESTED, for Tels +sub fast_yaml { + my($self) = @_; + my $meta = $self->pretty_id; + $meta =~ s/\.(tar.gz|tgz|zip|tar.bz2)/.meta/; + my(@ls) = CPAN::Shell->globls($meta); + my $norm = $self->normalize($meta); + + my($local_file); + my($local_wanted) = + File::Spec->catfile( + $CPAN::Config->{keep_source_where}, + "authors", + "id", + split(/\//,$norm) + ); + $self->debug("Doing localize") if $CPAN::DEBUG; + unless ($local_file = + CPAN::FTP->localize("authors/id/$norm", + $local_wanted)) { + $CPAN::Frontend->mydie("Giving up on downloading yaml file '$local_wanted'\n"); + } + if ($CPAN::META->has_inst("YAML")) { + my $yaml = YAML::LoadFile($local_file); + return $yaml; + } else { + $CPAN::Frontend->mydie("Yaml not installed, cannot parse '$local_file'\n"); + } +} + sub pretty_id { my $self = shift; my $id = $self->id; @@ -4468,7 +4540,7 @@ and there run Package comes with a Makefile and without a Makefile.PL. We\'ll try to build it with that Makefile then. }); - $self->{writemakefile} = "YES"; + $self->{writemakefile} = CPAN::Distrostatus->new("YES"); sleep 2; } else { my $cf = $self->called_for || "unknown"; @@ -4718,6 +4790,7 @@ sub verifyCHECKSUM { $self->CHECKSUM_check_file($lc_file); } +#-> sub CPAN::Distribution::SIG_check_file ; sub SIG_check_file { my($self,$chk_file) = @_; my $rv = eval { Module::Signature::_verify($chk_file) }; @@ -4877,11 +4950,14 @@ sub eq_CHECKSUM { # routine, and immediately before we check for a Signal. I hope this # works out in one of v1.57_53ff +# "Force get forgets previous error conditions" + +#-> sub CPAN::Distribution::force ; sub force { my($self, $method) = @_; for my $att (qw( CHECKSUM_STATUS archived build_dir localfile make install unwrapped - writemakefile modulebuild + writemakefile modulebuild make_test )) { delete $self->{$att}; } @@ -4971,6 +5047,10 @@ or } } $self->get; + if ($CPAN::Signal){ + delete $self->{force_update}; + return; + } EXCUSE: { my @e; !$self->{archived} || $self->{archived} eq "NO" and push @e, @@ -4988,9 +5068,21 @@ or and push @e, "Did not pass the signature test."; } - exists $self->{writemakefile} && - $self->{writemakefile} =~ m/ ^ NO\s* ( .* ) /sx and push @e, - $1 || "Had some problem writing Makefile"; + if (exists $self->{writemakefile} && + ( + $self->{writemakefile}->can("failed") ? + $self->{writemakefile}->failed : + $self->{writemakefile} =~ /^NO/ + )) { + # XXX maybe a retry would be in order? + my $err = $self->{writemakefile}->can("text") ? + $self->{writemakefile}->text : + $self->{writemakefile}; + $err =~ s/^NO\s*//; + $err ||= "Had some problem writing Makefile"; + $err .= ", won't make"; + push @e, $err; + } defined $self->{'make'} and push @e, "Has already been processed within this session"; @@ -5005,6 +5097,10 @@ or $CPAN::Frontend->myprint(join "", map {" $_\n"} @e) and return if @e; } + if ($CPAN::Signal){ + delete $self->{force_update}; + return; + } $CPAN::Frontend->myprint("\n CPAN.pm: Going to build ".$self->id."\n\n"); my $builddir = $self->dir or $CPAN::Frontend->mydie("PANIC: Cannot determine build directory"); @@ -5029,7 +5125,11 @@ or # $switch = "-MExtUtils::MakeMaker ". # "-Mops=:default,:filesys_read,:filesys_open,require,chdir" # if $] > 5.00310; - $system = "$perl $switch Makefile.PL $CPAN::Config->{makepl_arg}"; + $system = sprintf("%s%s Makefile.PL%s", + $perl, + $switch ? " $switch" : "", + $CPAN::Config->{makepl_arg} ? " $CPAN::Config->{makepl_arg}" : "", + ); } unless (exists $self->{writemakefile}) { local($SIG{ALRM}) = sub { die "inactivity_timeout reached\n" }; @@ -5059,27 +5159,24 @@ or kill 9, $pid; waitpid $pid, 0; $CPAN::Frontend->myprint($@); - $self->{writemakefile} = "NO $@"; + $self->{writemakefile} = CPAN::Distrostatus->new("NO $@"); $@ = ""; return; } } else { $ret = system($system); if ($ret != 0) { - $self->{writemakefile} = "NO '$system' returned status $ret"; + $self->{writemakefile} = CPAN::Distrostatus + ->new("NO '$system' returned status $ret"); return; } } if (-f "Makefile" || -f "Build") { - $self->{writemakefile} = "YES"; + $self->{writemakefile} = CPAN::Distrostatus->new("YES"); delete $self->{make_clean}; # if cleaned before, enable next } else { - $self->{writemakefile} = - qq{NO -- Unknown reason.}; - # It's probably worth it to record the reason, so let's retry - # local $/; - # my $fh = IO::File->new("$system |"); # STDERR? STDIN? - # $self->{writemakefile} .= <$fh>; + $self->{writemakefile} = CPAN::Distrostatus + ->new(qq{NO -- Unknown reason.}); } } if ($CPAN::Signal){ @@ -5098,7 +5195,7 @@ or $CPAN::Frontend->myprint(" $system -- OK\n"); $self->{'make'} = CPAN::Distrostatus->new("YES"); } else { - $self->{writemakefile} ||= "YES"; + $self->{writemakefile} ||= CPAN::Distrostatus->new("YES"); $self->{'make'} = CPAN::Distrostatus->new("NO"); $CPAN::Frontend->myprint(" $system -- NOT OK\n"); } @@ -5363,8 +5460,10 @@ sub test { } EXCUSE: { my @e; - exists $self->{make} or exists $self->{later} or push @e, - "Make had some problems, maybe interrupted? Won't test"; + unless (exists $self->{make} or exists $self->{later}) { + push @e, + "Make had some problems, won't test"; + } exists $self->{make} and ( @@ -5398,6 +5497,8 @@ sub test { : ($ENV{PERLLIB} || ""); $CPAN::META->set_perl5lib; + local $ENV{MAKEFLAGS}; # protect us from outer make calls + my $system; if ($self->{modulebuild}) { $system = sprintf "%s test", $self->_build_command(); @@ -5420,6 +5521,11 @@ sub clean { my($self) = @_; my $make = $self->{modulebuild} ? "Build" : "make"; $CPAN::Frontend->myprint("Running $make clean\n"); + unless (exists $self->{archived}) { + $CPAN::Frontend->mywarn("Distribution seems to have never been unzipped". + "/untarred, nothing done\n"); + return 1; + } unless (exists $self->{build_dir}) { $CPAN::Frontend->mywarn("Distribution has no own directory, nothing to do.\n"); return 1; @@ -5492,8 +5598,10 @@ sub install { my @e; exists $self->{build_dir} or push @e, "Has no own directory"; - exists $self->{make} or exists $self->{later} or push @e, - "Make had some problems, maybe interrupted? Won't install"; + unless (exists $self->{make} or exists $self->{later}) { + push @e, + "Make had some problems, won't install"; + } exists $self->{make} and ( @@ -5517,9 +5625,17 @@ sub install { "won't install without force" } } - exists $self->{'install'} and push @e, - $self->{'install'}->text eq "YES" ? - "Already done" : "Already tried without success"; + if (exists $self->{'install'}) { + if ($self->{'install'}->can("text") ? + $self->{'install'}->text eq "YES" : + $self->{'install'} =~ /^YES/ + ) { + push @e, "Already done"; + } else { + # comment in Todo on 2006-02-11; maybe retry? + push @e, "Already tried without success"; + } + } exists $self->{later} and length($self->{later}) and push @e, $self->{later}; @@ -5610,17 +5726,18 @@ sub perldoc { #-> sub CPAN::Distribution::_check_binary ; sub _check_binary { my ($dist,$shell,$binary) = @_; - my ($pid,$readme,$out); + my ($pid,$out); $CPAN::Frontend->myprint(qq{ + _check_binary($binary)\n}) if $CPAN::DEBUG; - $pid = open $readme, "which $binary|" + local *README; + $pid = open README, "which $binary|" or $CPAN::Frontend->mydie(qq{Could not fork 'which $binary': $!}); - while (<$readme>) { + while (<README>) { $out .= $_; } - close $readme or die "Could not run 'which $binary': $!"; + close README or die "Could not run 'which $binary': $!"; $CPAN::Frontend->myprint(qq{ + $out \n}) if $CPAN::DEBUG && $out; @@ -5631,7 +5748,7 @@ sub _check_binary { #-> sub CPAN::Distribution::_display_url ; sub _display_url { my($self,$url) = @_; - my($res,$saved_file,$pid,$readme,$out); + my($res,$saved_file,$pid,$out); $CPAN::Frontend->myprint(qq{ + _display_url($url)\n}) if $CPAN::DEBUG; @@ -5644,8 +5761,20 @@ sub _display_url { ? CPAN::Distribution->_check_binary($self,$web_browser) : undef; - my ($tmpout,$tmperr); - if (not $web_browser_out) { + if ($web_browser_out) { + # web browser found, run the action + my $browser = $CPAN::Config->{'lynx'}; + $CPAN::Frontend->myprint(qq{system[$browser $url]}) + if $CPAN::DEBUG; + $CPAN::Frontend->myprint(qq{ +Displaying URL + $url +with browser $browser +}); + sleep 2; + system("$browser $url"); + if ($saved_file) { 1 while unlink($saved_file) } + } else { # web browser not found, let's try text only my $html_converter_out = CPAN::Distribution->_check_binary($self,$html_converter); @@ -5653,64 +5782,61 @@ sub _display_url { if ($html_converter_out ) { # html2text found, run it $saved_file = CPAN::Distribution->_getsave_url( $self, $url ); - $CPAN::Frontend->myprint(qq{ERROR: problems while getting $url, $!\n}) - unless defined($saved_file); + $CPAN::Frontend->mydie(qq{ERROR: problems while getting $url\n}) + unless defined($saved_file); - $pid = open $readme, "$html_converter $saved_file |" + local *README; + $pid = open README, "$html_converter $saved_file |" or $CPAN::Frontend->mydie(qq{ Could not fork '$html_converter $saved_file': $!}); - my $fh = File::Temp->new( - template => 'cpan_htmlconvert_XXXX', - suffix => '.txt', - unlink => 0, - ); - while (<$readme>) { + my($fh,$filename); + if ($CPAN::META->has_inst("File::Temp")) { + $fh = File::Temp->new( + template => 'cpan_htmlconvert_XXXX', + suffix => '.txt', + unlink => 0, + ); + $filename = $fh->filename; + } else { + $filename = "cpan_htmlconvert_$$.txt"; + $fh = FileHandle->new(); + open $fh, ">$filename" or die; + } + while (<README>) { $fh->print($_); } - close $readme - or $CPAN::Frontend->mydie(qq{Could not run '$html_converter $saved_file': $!}); + close README or + $CPAN::Frontend->mydie(qq{Could not run '$html_converter $saved_file': $!}); my $tmpin = $fh->filename; - $CPAN::Frontend->myprint(sprintf(qq{ + $CPAN::Frontend->myprint(sprintf(qq{ Run '%s %s' and saved output to %s\n}, $html_converter, $saved_file, $tmpin, )) if $CPAN::DEBUG; - close $fh; undef $fh; - open $fh, $tmpin - or $CPAN::Frontend->mydie(qq{Could not open "$tmpin": $!}); + close $fh; + local *FH; + open FH, $tmpin + or $CPAN::Frontend->mydie(qq{Could not open "$tmpin": $!}); my $fh_pager = FileHandle->new; local($SIG{PIPE}) = "IGNORE"; $fh_pager->open("|$CPAN::Config->{'pager'}") - or $CPAN::Frontend->mydie(qq{ + or $CPAN::Frontend->mydie(qq{ Could not open pager $CPAN::Config->{'pager'}: $!}); - $CPAN::Frontend->myprint(qq{ + $CPAN::Frontend->myprint(qq{ Displaying URL $url with pager "$CPAN::Config->{'pager'}" }); - sleep 2; - $fh_pager->print(<$fh>); - $fh_pager->close; + sleep 2; + $fh_pager->print(<FH>); + $fh_pager->close; } else { # coldn't find the web browser or html converter $CPAN::Frontend->myprint(qq{ You need to install lynx or $html_converter to use this feature.}); } - } else { - # web browser found, run the action - my $browser = $CPAN::Config->{'lynx'}; - $CPAN::Frontend->myprint(qq{system[$browser $url]}) - if $CPAN::DEBUG; - $CPAN::Frontend->myprint(qq{ -Displaying URL - $url -with browser $browser -}); - sleep 2; - system("$browser $url"); - if ($saved_file) { 1 while unlink($saved_file) } } } @@ -5721,29 +5847,36 @@ sub _getsave_url { $CPAN::Frontend->myprint(qq{ + _getsave_url($url)\n}) if $CPAN::DEBUG; - my $fh = File::Temp->new( + my($fh,$filename); + if ($CPAN::META->has_inst("File::Temp")) { + $fh = File::Temp->new( template => "cpan_getsave_url_XXXX", suffix => ".html", unlink => 0, ); - my $tmpin = $fh->filename; + $filename = $fh->filename; + } else { + $fh = FileHandle->new; + $filename = "cpan_getsave_url_$$.html"; + } + my $tmpin = $filename; if ($CPAN::META->has_usable('LWP')) { $CPAN::Frontend->myprint("Fetching with LWP: $url "); my $Ua; CPAN::LWP::UserAgent->config; - eval { $Ua = CPAN::LWP::UserAgent->new; }; - if ($@) { - $CPAN::Frontend->mywarn("ERROR: CPAN::LWP::UserAgent->new dies with $@\n"); - return; - } else { - my($var); - $Ua->proxy('http', $var) + eval { $Ua = CPAN::LWP::UserAgent->new; }; + if ($@) { + $CPAN::Frontend->mywarn("ERROR: CPAN::LWP::UserAgent->new dies with $@\n"); + return; + } else { + my($var); + $Ua->proxy('http', $var) if $var = $CPAN::Config->{http_proxy} || $ENV{http_proxy}; - $Ua->no_proxy($var) + $Ua->no_proxy($var) if $var = $CPAN::Config->{no_proxy} || $ENV{no_proxy}; - } + } my $req = HTTP::Request->new(GET => $url); $req->header('Accept' => 'text/html'); @@ -6555,14 +6688,6 @@ sub inst_version { local($^W) = 0 if $] < 5.00303 && $ExtUtils::MakeMaker::VERSION < 5.38; my $have; - # there was a bug in 5.6.0 that let lots of unini warnings out of - # parse_version. Fixed shortly after 5.6.0 by PMQS. We can remove - # the following workaround after 5.6.1 is out. - local($SIG{__WARN__}) = sub { my $w = shift; - return if $w =~ /uninitialized/i; - warn $w; - }; - $have = MM->parse_version($parsefile) || "undef"; $have =~ s/^ //; # since the %vd hack these two lines here are needed $have =~ s/ $//; # trailing whitespace happens all the time @@ -7096,6 +7221,11 @@ Returns a one-line description of the distribution Returns a multi-line description of the distribution +=item CPAN::Distribution::author + +Returns the CPAN::Author object of the maintainer who uploaded this +distribution + =item CPAN::Distribution::clean() Changes to the directory where the distribution has been unpacked and @@ -7163,11 +7293,21 @@ downloaded and unpacked. Changes to the directory where the distribution has been unpacked and runs the external commands C<perl Makefile.PL> or C<perl Build.PL> and C<make> there. +=item CPAN::Distribution::perldoc() + +Downloads the pod documentation of the file associated with a +distribution (in html format) and runs it through the external +command lynx specified in C<$CPAN::Config->{lynx}>. If lynx +isn't available, it converts it to plain text with external +command html2text and runs it through the pager specified +in C<$CPAN::Config->{pager}> + =item CPAN::Distribution::prereq_pm() Returns the hash reference that has been announced by a distribution -as the C<requires> element of the META.yml or the C<PREREQ_PM> hash in -the C<Makefile.PL>. Note: works only after an attempt has been made to +as the merge of the C<requires> element and the C<build_requires> +element of the META.yml or the C<PREREQ_PM> hash in the +C<Makefile.PL>. Note: works only after an attempt has been made to C<make> the distribution. Returns undef otherwise. =item CPAN::Distribution::readme() @@ -7175,14 +7315,11 @@ C<make> the distribution. Returns undef otherwise. Downloads the README file associated with a distribution and runs it through the pager specified in C<$CPAN::Config->{pager}>. -=item CPAN::Distribution::perldoc() +=item CPAN::Distribution::read_yaml() -Downloads the pod documentation of the file associated with a -distribution (in html format) and runs it through the external -command lynx specified in C<$CPAN::Config->{lynx}>. If lynx -isn't available, it converts it to plain text with external -command html2text and runs it through the pager specified -in C<$CPAN::Config->{pager}> +Returns the content of the META.yml of this distro as a hashref. Note: +works only after an attempt has been made to C<make> the distribution. +Returns undef otherwise. =item CPAN::Distribution::test() @@ -7240,6 +7377,11 @@ Returns a 44 character description of this module. Only available for modules listed in The Module List (CPAN/modules/00modlist.long.html or 00modlist.long.txt.gz) +=item CPAN::Module::distribution() + +Returns the CPAN::Distribution object that contains the current +version of this module. + =item CPAN::Module::force($method,@args) Forces CPAN to perform a task that normally would have failed. Force @@ -7283,14 +7425,14 @@ headline and returns it. Moreover, if the module has been downloaded within this session, does the equivalent on the downloaded module even if it is not installed. -=item CPAN::Module::readme() - -Runs a C<readme> on the distribution associated with this module. - =item CPAN::Module::perldoc() Runs a C<perldoc> on this module. +=item CPAN::Module::readme() + +Runs a C<readme> on the distribution associated with this module. + =item CPAN::Module::test() Runs a C<test> on the distribution associated with this module. @@ -7444,7 +7586,7 @@ defined: build_dir locally accessible directory to build modules cache_metadata use serializer to cache metadata cpan_home local directory reserved for this package - dontload_hash anonymous hash: modules in the keys will not be + dontload_list arrayref: modules in the list will not be loaded by the CPAN::has_inst() routine getcwd see below gzip location of external program gzip @@ -7471,9 +7613,11 @@ defined: in the install stage, for example 'sudo ./Build' mbuildpl_arg arguments passed to 'perl Build.PL' pager location of external program more (or any pager) - prefer_installer legal values are MB and EUMM: if a module - comes with both a Makefile.PL and a Build.PL, use - the former (EUMM) or the latter (MB) + prefer_installer legal values are MB and EUMM: if a module comes + with both a Makefile.PL and a Build.PL, use the + former (EUMM) or the latter (MB); if the module + comes with only one of the two, that one will be + used in any case prerequisites_policy what to do if you are missing module prerequisites ('follow' automatically, 'ask' me, or 'ignore') @@ -7602,10 +7746,10 @@ already set. When the config variable ftp_passive is set, all downloads will be run with the environment variable FTP_PASSIVE set to this value. This is -in general a good idea. The same effect can be achieved by starting -the cpan shell with the environment variable. If Net::FTP is -installed, then it can also be configured to always set passive mode -(run libnetcfg). +in general a good idea as it influences both Net::FTP and LWP based +connections. The same effect can be achieved by starting the cpan +shell with this environment variable set. For Net::FTP alone, one can +also always set passive mode by running libnetcfg. =head1 POPULATE AN INSTALLATION WITH LOTS OF MODULES @@ -7695,15 +7839,9 @@ This is the firewall implemented in the Linux kernel, it allows you to hide a complete network behind one IP address. With this firewall no special compiling is needed as you can access hosts directly. -For accessing ftp servers behind such firewalls you may need to set -the environment variable C<FTP_PASSIVE> to a true value, e.g. - - env FTP_PASSIVE=1 perl -MCPAN -eshell - -or - - perl -MCPAN -e '$ENV{FTP_PASSIVE} = 1; shell' - +For accessing ftp servers behind such firewalls you usually need to +set the environment variable C<FTP_PASSIVE> or the config variable +ftp_passive to a true value. =back @@ -7823,8 +7961,10 @@ including or setting the PERL5LIB environment variable. -Another thing you should bear in mind is that the UNINST parameter -should never be set if you are not root. +Another thing you should bear in mind is that the UNINST parameter can +be dnagerous when you are installing into a private area because you +might accidentally remove modules that other people depend on that are +not using the private area. =item 6) @@ -7930,15 +8070,15 @@ By default, CPAN will install the latest non-developer release of a module. If you want to install a dev release, you have to specify a partial path to the tarball you wish to install, like so: - cpan> install KWILLIAMS/Module-Build-0.27_06.tar.gz + cpan> install KWILLIAMS/Module-Build-0.27_07.tar.gz =item 13) -How do I install a module and all it's dependancies from the commandline, +How do I install a module and all its dependencies from the commandline, without being prompted for anything, despite my CPAN configuration (or lack thereof)? -CPAN uses ExtUtils::MakeMaker's prompt() function to ask it's questions, so +CPAN uses ExtUtils::MakeMaker's prompt() function to ask its questions, so if you set the PERL_MM_USE_DEFAULT environment variable, you shouldn't be asked any questions at all (assuming the modules you are installing are nice about obeying that variable as well): @@ -7949,12 +8089,12 @@ nice about obeying that variable as well): =head1 BUGS -If a Makefile.PL requires special customization of libraries, prompts -the user for special input, etc. then you may find CPAN is not able to -build the distribution. In that case it is recommended to attempt the -traditional method of building a Perl module package from a shell, for -example by using the 'look' command to open a subshell in the -distribution's own directory. +Please report bugs via http://rt.cpan.org/ + +Before submitting a bug, please make sure that the traditional method +of building a Perl module package from a shell by following the +installation instructions of that package still works in your +environment. =head1 AUTHOR diff --git a/lib/CPAN/Debug.pm b/lib/CPAN/Debug.pm index 823ad73..489c53f 100644 --- a/lib/CPAN/Debug.pm +++ b/lib/CPAN/Debug.pm @@ -2,7 +2,7 @@ package CPAN::Debug; use strict; use vars qw($VERSION); -$VERSION = sprintf "%.2f", substr(q$Rev: 444 $,4)/100; +$VERSION = sprintf "%.6f", substr(q$Rev: 561 $,4)/1000000 + 5.4; # module is internal to CPAN.pm %CPAN::DEBUG = qw[ diff --git a/lib/CPAN/FirstTime.pm b/lib/CPAN/FirstTime.pm index 50843ad..62b8ad1 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 "%.2f", substr(q$Rev: 485 $,4)/100; +$VERSION = sprintf "%.6f", substr(q$Rev: 561 $,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); -$VERSION = sprintf "%.2f", substr(q$Rev: 485 $,4)/100; +$VERSION = sprintf "%.6f", substr(q$Rev: 561 $,4)/1000000 + 5.4; =head1 NAME diff --git a/lib/CPAN/HandleConfig.pm b/lib/CPAN/HandleConfig.pm index 669e3bb..fdef34b 100644 --- a/lib/CPAN/HandleConfig.pm +++ b/lib/CPAN/HandleConfig.pm @@ -2,33 +2,64 @@ package CPAN::HandleConfig; use strict; use vars qw(%can %keys $dot_cpan $VERSION); -$VERSION = sprintf "%.2f", substr(q$Rev: 488 $,4)/100; +$VERSION = sprintf "%.6f", substr(q$Rev: 581 $,4)/1000000 + 5.4; %can = ( - 'commit' => "Commit changes to disk", - 'defaults' => "Reload defaults from disk", - 'init' => "Interactive setting of all options", + commit => "Commit changes to disk", + defaults => "Reload defaults from disk", + help => "Short help about 'o conf' usage", + init => "Interactive setting of all options", ); -%keys = map { $_ => undef } qw( - build_cache build_dir bzip2 - cache_metadata commandnumber_in_prompt cpan_home curl - dontload_hash - ftp ftp_passive ftp_proxy - getcwd gpg gzip - histfile histsize http_proxy - inactivity_timeout index_expire inhibit_startup_message - keep_source_where - lynx - make make_arg make_install_arg make_install_make_command makepl_arg - mbuild_arg mbuild_install_arg mbuild_install_build_command mbuildpl_arg - ncftp ncftpget no_proxy pager - prefer_installer prerequisites_policy - scan_cache shell show_upload_date - tar term_is_latin - unzip urllist - wait_list wget -); +%keys = map { $_ => undef } ( + "build_cache", + "build_dir", + "bzip2", + "cache_metadata", + "commandnumber_in_prompt", + "cpan_home", + "curl", + "dontload_hash", # deprecated after 1.83_68 (rev. 581) + "dontload_list", + "ftp", + "ftp_passive", + "ftp_proxy", + "getcwd", + "gpg", + "gzip", + "histfile", + "histsize", + "http_proxy", + "inactivity_timeout", + "index_expire", + "inhibit_startup_message", + "keep_source_where", + "lynx", + "make", + "make_arg", + "make_install_arg", + "make_install_make_command", + "makepl_arg", + "mbuild_arg", + "mbuild_install_arg", + "mbuild_install_build_command", + "mbuildpl_arg", + "ncftp", + "ncftpget", + "no_proxy", + "pager", + "prefer_installer", + "prerequisites_policy", + "scan_cache", + "shell", + "show_upload_date", + "tar", + "term_is_latin", + "unzip", + "urllist", + "wait_list", + "wget", + ); if ($^O eq "MSWin32") { for my $k (qw( mbuild_install_build_command @@ -86,10 +117,15 @@ sub edit { } else { $self->prettyprint($o); } - if ($o eq "urllist" && $changed) { - # reset the cached values - undef $CPAN::FTP::Thesite; - undef $CPAN::FTP::Themethod; + if ($changed) { + if ($o eq "urllist") { + # reset the cached values + undef $CPAN::FTP::Thesite; + undef $CPAN::FTP::Themethod; + } elsif ($o eq "dontload_list") { + # empty it, it will be built up again + $CPAN::META->{dontload_hash} = {}; + } } return $changed; } elsif ($o =~ /_hash$/) { @@ -380,20 +416,17 @@ sub missing_config_data { sub help { $CPAN::Frontend->myprint(q[ Known options: - defaults reload default config values from disk commit commit session changes to disk + defaults reload default config values from disk + help this help init go through a dialog to set all parameters -You may edit key values in the follow fashion (the "o" is a literal -letter o): - +Edit key values as in the following (the "o" is a literal letter o): o conf build_cache 15 - o conf build_dir "/foo/bar" - o conf urllist shift - o conf urllist unshift ftp://ftp.foo.bar/ + o conf inhibit_startup_message 1 ]); undef; #don't reprint CPAN::Config @@ -426,8 +459,8 @@ sub cpl { } -package ####::###### #hide from indexer - CPAN::Config; +package + CPAN::Config; ####::###### #hide from indexer # note: J. Nick Koston wrote me that they are using # CPAN::Config->commit although undocumented. I suggested # CPAN::Shell->o("conf","commit") even when ugly it is at least @@ -438,7 +471,7 @@ package ####::###### #hide from indexer use strict; use vars qw($AUTOLOAD $VERSION); -$VERSION = sprintf "%.2f", substr(q$Rev: 488 $,4)/100; +$VERSION = sprintf "%.2f", substr(q$Rev: 581 $,4)/100; # formerly CPAN::HandleConfig was known as CPAN::Config sub AUTOLOAD { diff --git a/lib/CPAN/Nox.pm b/lib/CPAN/Nox.pm index 41a7898..41bedf3 100644 --- a/lib/CPAN/Nox.pm +++ b/lib/CPAN/Nox.pm @@ -9,7 +9,7 @@ BEGIN{ use base 'Exporter'; use CPAN; -$VERSION = sprintf "%.2f", substr(q$Rev: 231 $,4)/100; +$VERSION = sprintf "%.6f", substr(q$Rev: 561 $,4)/1000000 + 5.4; $CPAN::META->has_inst('Digest::MD5','no'); $CPAN::META->has_inst('LWP','no'); $CPAN::META->has_inst('Compress::Zlib','no'); diff --git a/lib/CPAN/SIGNATURE b/lib/CPAN/SIGNATURE index 8991293..65180c5 100644 --- a/lib/CPAN/SIGNATURE +++ b/lib/CPAN/SIGNATURE @@ -14,43 +14,58 @@ not run its Makefile.PL or Build.PL. -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -SHA1 649da294e424ab12cef006be80f29851eeed8eea ChangeLog +SHA1 86cd5afb7a277053d01ffb57ba9cdb91f5729333 ChangeLog SHA1 9b97524a7a91c815e46b19302a33829d3c26bbbf ChangeLog.old -SHA1 7795d2ac6a0f70f933b47af088417af0e91db952 Changes +SHA1 ee18200033ca0b29847e9966b15b937c2847f2ce Changes SHA1 a029ffa2f2252bb8914eb658666244710994d256 Changes.old -SHA1 b3fc1dfd25885b80d144cf817b9f0b1c88fe41d6 MANIFEST -SHA1 eeff7e8175811b30cdcfddd74c30c5ea4c13d43e MANIFEST.SKIP -SHA1 280263caec45d15f670b15d10f29973a56cf49b1 META.yml -SHA1 27df1ed86de0f2b87bba5f7d0bb752690c6eb399 Makefile.PL +SHA1 74d91a5b2d7a59968705d95adc88c716a23f9adb MANIFEST +SHA1 3c4dbf3f48e16467eb557e6f6a9b9cd6901fe2dd MANIFEST.SKIP +SHA1 523d4816f21a174124c6ca1985f33a9ffc30732a META.yml +SHA1 bfc9ab219364977427c226c01fe322feeed4ac66 Makefile.PL SHA1 37e858c51409a297ef5d3fb35dc57cd3b57f9a4d PAUSE2003.pub SHA1 af016003ad503ed078c5f8254521d13a3e0c494f PAUSE2005.pub -SHA1 c23965271da3c67a1a5a061b9ce7ede5b50a749f README -SHA1 d71298503e8bd777891d72cf2271693c514f5283 Todo +SHA1 0ae05b5134d40c15ed43bd52189373e4d10dfb8f README +SHA1 9d779ce923bd8a81f6b8f25b34a39763fa84c33d Todo SHA1 efbe8e6882a2caa0d741b113959a706830ab5882 inc/Test/Builder.pm SHA1 ae1d68262bedc2475e2c6fd478d99b259b4fb109 inc/Test/More.pm SHA1 06a0406535e8ae4057e374d4ea8cd5b105483803 lib/Bundle/CPAN.pm -SHA1 82ab8f61c57da30ae9c67eab1f49cc6ef2da12f5 lib/CPAN.pm -SHA1 104fd2b39fdba692143655b53bcf01d36c8ebf68 lib/CPAN/Admin.pm -SHA1 82acb5a70221cd4ebc82e96f95f537018e39c79e lib/CPAN/Debug.pm -SHA1 b5bced5735a8736f317eba67c3319a82345d22c9 lib/CPAN/FirstTime.pm -SHA1 20e41047e4aaa68854186c03d5252ad536d254dc lib/CPAN/HandleConfig.pm -SHA1 4fa9695417b54fc8d4e29684ad61689bc108274b lib/CPAN/Nox.pm -SHA1 e85202a30802f3cd86e67af649ba219d97b0925c lib/CPAN/Tarzip.pm -SHA1 726e924200e3e2fda54caa4eddf7029a02f43efe lib/CPAN/Version.pm +SHA1 c937d2b2aa5d2e2f26934bfc60f64cbb60e98664 lib/CPAN.pm +SHA1 94c4656fdae231c673719978e6e9a460f2dfc794 lib/CPAN/Admin.pm +SHA1 8884e4b1932555e7d2f52d1df62097e8c78bb548 lib/CPAN/Debug.pm +SHA1 0961261e5a334fbce8e465d68e3513776ca4ad16 lib/CPAN/FirstTime.pm +SHA1 c3f2256705e2af3f467977515065dc343ddfdd0e lib/CPAN/HandleConfig.pm +SHA1 f7b20d828c197710b4eac3029a30266242fb782b lib/CPAN/Nox.pm +SHA1 4b6c040b3ce14f660a1b99da34cd020343878796 lib/CPAN/Tarzip.pm +SHA1 4d60b4782a851767c40dc27825057e584014cfc5 lib/CPAN/Version.pm SHA1 fb08e07d8740ef36e8ab719c6a9b7e89c4fe674a scripts/cpan -SHA1 fd5431e748094972572d216dfb55c69b14433205 t/CPAN/TestConfig.pm -SHA1 67e80e1cfc3530932de7743dd0c833b2c387609d t/Nox.t -SHA1 215dace24b507de20011d36cbe2d16ddea78bcf3 t/loadme.t -SHA1 325d8a2f72d59c4cd2400c72403c05cd614c3abc t/mirroredby.t -SHA1 6a79f15a10337bd3450604abf39d4462df2a550b t/pod.t -SHA1 274110e8c8353912bb849cec6556f2267b8c5c92 t/shell.t -SHA1 0c3509be603b7ae86d5e7bd422d9bb6054da0935 t/signature.t -SHA1 fdc0f927e3442829ab3b7d40cb63b0223c49abc6 t/vcmp.t -SHA1 b505a0db80ed4c835ad5676e9d1cbf09c86e6c34 t/version.t +SHA1 0c3509be603b7ae86d5e7bd422d9bb6054da0935 t/00signature.t +SHA1 215dace24b507de20011d36cbe2d16ddea78bcf3 t/01loadme.t +SHA1 67e80e1cfc3530932de7743dd0c833b2c387609d t/02nox.t +SHA1 0d1037e7e7a5f6e47d3f5db07fdff995e6d0de5d t/03pkgs.t +SHA1 ebdb653877d5c5e5a071fe9933b18f018cde3250 t/10version.t +SHA1 325d8a2f72d59c4cd2400c72403c05cd614c3abc t/11mirroredby.t +SHA1 ab196b37cd30d59a30ab841bc17e66dd64993a25 t/30shell.t +SHA1 6a79f15a10337bd3450604abf39d4462df2a550b t/50pod.t +SHA1 70f0df4041b1c9ae9f30117b0fad9fe5760f17c8 t/CPAN/TestConfig.pm +SHA1 b4fd27234696da334ac6a1716222c70610a98c3a t/CPAN/authors/01mailrc.txt +SHA1 bcbe30403a46ad3db1f67757ddc7610064f21fe5 t/CPAN/authors/id/A/AN/ANDK/CHECKSUMS +SHA1 3bafbff953a645fccf54e505a71ef711ba895522 t/CPAN/authors/id/A/AN/ANDK/CPAN-Test-Dummy-Perl5-Build-1.01.tar.gz +SHA1 11f35aa730e452797f5d7371a393e24e40ea8d21 t/CPAN/authors/id/A/AN/ANDK/CPAN-Test-Dummy-Perl5-Build-Fails-1.01.tar.gz +SHA1 c0587c6180bd979acfa2b2396688208793366ff5 t/CPAN/authors/id/A/AN/ANDK/CPAN-Test-Dummy-Perl5-BuildOrMake-1.01.tar.gz +SHA1 39dda723d77bb5386bfc837e9ee5224513db19c0 t/CPAN/authors/id/A/AN/ANDK/CPAN-Test-Dummy-Perl5-Make-1.01.tar.gz +SHA1 3dc672ec2542810513b26e306a6545bfee069654 t/CPAN/authors/id/A/AN/ANDK/CPAN-Test-Dummy-Perl5-Make-Failearly-1.01.tar.gz +SHA1 1883e4297cf678df8171929d157efd6815b9c9b1 t/CPAN/authors/id/A/AN/ANDK/CPAN-Test-Dummy-Perl5-Make-Zip-1.01.zip +SHA1 1aee1bed21f0e9755d693419e810ec75543eb0b7 t/CPAN/authors/id/A/AN/CHECKSUMS +SHA1 1f3304f219bf0da4db6a60f638e11b61c2c2f4c0 t/CPAN/authors/id/A/CHECKSUMS +SHA1 dfc900f5bfbc9683fa91977a1c7198222fbd4452 t/CPAN/authors/id/CHECKSUMS +SHA1 e7c40882588d89d0766b9134619e0ee226dc3c1b t/CPAN/modules/02packages.details.txt +SHA1 9bbcc30e783e5fe67e2aa12d5f1fe113563e345c t/CPAN/modules/03modlist.data +SHA1 c0dde5b2aa7713d1a1ffbbbf6a08c2f46aad4f1d t/README.shell.txt +SHA1 1539d7c98dd4e61435f71797cc5eb0b49c057898 t/dot-cpan/Bundle/CpanTestDummies.pm -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) -iD8DBQFD4c2e7IA58KMXwV0RAqUtAJ4nelMoeiUIe6JqLAMKqmvTEAbuzgCguPIh -ZiSdaiDh1S5qiobZ9ATaGWY= -=vJZ9 +iD8DBQFD8tDI7IA58KMXwV0RAlBbAKCGAkF/EP2OiCLnyrICqHwyaIyi4QCg2JWu +IodF0KHpDl45G/ValTOHhQY= +=mAhM -----END PGP SIGNATURE----- diff --git a/lib/CPAN/Tarzip.pm b/lib/CPAN/Tarzip.pm index 2433bf8..05b207c 100644 --- a/lib/CPAN/Tarzip.pm +++ b/lib/CPAN/Tarzip.pm @@ -4,7 +4,7 @@ use strict; use vars qw($VERSION @ISA $BUGHUNTING); use CPAN::Debug; use File::Basename (); -$VERSION = sprintf "%.2f", substr(q$Rev: 336 $,4)/100; +$VERSION = sprintf "%.6f", substr(q$Rev: 561 $,4)/1000000 + 5.4; # module is internal to CPAN.pm @ISA = qw(CPAN::Debug); diff --git a/lib/CPAN/Version.pm b/lib/CPAN/Version.pm index 3579863..1de8249 100644 --- a/lib/CPAN/Version.pm +++ b/lib/CPAN/Version.pm @@ -36,7 +36,7 @@ package CPAN::Version; use strict; use vars qw($VERSION); -$VERSION = "2.55"; +$VERSION = sprintf "%.6f", substr(q$Rev: 561 $,4)/1000000 + 5.4; # CPAN::Version::vcmp courtesy Jost Krieger sub vcmp { diff --git a/lib/CPAN/t/loadme.t b/lib/CPAN/t/01loadme.t similarity index 100% rename from lib/CPAN/t/loadme.t rename to lib/CPAN/t/01loadme.t diff --git a/lib/CPAN/t/Nox.t b/lib/CPAN/t/02nox.t similarity index 100% rename from lib/CPAN/t/Nox.t rename to lib/CPAN/t/02nox.t diff --git a/lib/CPAN/t/version.t b/lib/CPAN/t/03pkgs.t similarity index 59% rename from lib/CPAN/t/version.t rename to lib/CPAN/t/03pkgs.t index eb1e557..d6fa715 100644 --- a/lib/CPAN/t/version.t +++ b/lib/CPAN/t/03pkgs.t @@ -2,8 +2,14 @@ use strict; eval 'use warnings'; -my @m = qw(CPAN CPAN::FirstTime CPAN::Nox CPAN::Version); -push @m, 'CPAN::Admin' unless $ENV{PERL_CORE}; + +opendir DH, "lib/CPAN" or die; +my @m; +if ($ENV{PERL_CORE}){ + @m = ("CPAN", map { "CPAN::$_" } qw(Debug FirstTime Nox Tarzip Version)); +} else { + @m = ("CPAN", map { "CPAN::$_" } grep { s/\.pm$// } readdir DH); +} use Test::More; plan(tests => scalar @m); diff --git a/lib/CPAN/t/vcmp.t b/lib/CPAN/t/10version.t similarity index 90% rename from lib/CPAN/t/vcmp.t rename to lib/CPAN/t/10version.t index 9152066..2002ebe 100644 --- a/lib/CPAN/t/vcmp.t +++ b/lib/CPAN/t/10version.t @@ -32,13 +32,15 @@ while (@$D) { } if ($has_versionpm) { local $^W; - my $vres = version->new($l) cmp version->new($r); + my $vpack = "version"; # hide the name from 5.004 + my $vres = $vpack->new($l) cmp $vpack->new($r); if ($vres != $res) { push @other, sprintf "v.pm: %d", $vres; } } my $other = @other ? " (".join("; ", @other).")" : ""; printf "ok %2d # %12s %12s %3d%s\n", $N-@$D, $l, $r, $res, $other; + die "Panic" if CPAN::Version->vgt($l,$r) && CPAN::Version->vlt($l,$r); } __END__ diff --git a/lib/CPAN/t/mirroredby.t b/lib/CPAN/t/11mirroredby.t similarity index 100% rename from lib/CPAN/t/mirroredby.t rename to lib/CPAN/t/11mirroredby.t