summaryrefslogtreecommitdiff
path: root/lib/CPAN
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-05-24 05:55:11 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-05-24 05:55:11 +0000
commit36263cb347dc0d66c6ed49be3e8c8a14c5d21ffb (patch)
tree02fef0edffa7688055321943baa77cadea5ddf5d /lib/CPAN
parentfaef01704ba77a858827d4e793b056731d6e6832 (diff)
downloadperl-36263cb347dc0d66c6ed49be3e8c8a14c5d21ffb.tar.gz
updated to v1.50 from CPAN
p4raw-id: //depot/perl@3458
Diffstat (limited to 'lib/CPAN')
-rw-r--r--lib/CPAN/FirstTime.pm41
-rw-r--r--lib/CPAN/Nox.pm3
2 files changed, 31 insertions, 13 deletions
diff --git a/lib/CPAN/FirstTime.pm b/lib/CPAN/FirstTime.pm
index 0d32a23c06..731d3ff2e4 100644
--- a/lib/CPAN/FirstTime.pm
+++ b/lib/CPAN/FirstTime.pm
@@ -16,7 +16,7 @@ use FileHandle ();
use File::Basename ();
use File::Path ();
use vars qw($VERSION);
-$VERSION = substr q$Revision: 1.35 $, 10;
+$VERSION = substr q$Revision: 1.37 $, 10;
=head1 NAME
@@ -77,6 +77,7 @@ dialog anytime later by typing 'o conf init' at the cpan prompt.)
*prompt = \&ExtUtils::MakeMaker::prompt;
} else {
$fastread = 1;
+ $CPAN::Config->{urllist} ||= [];
*prompt = sub {
my($q,$a) = @_;
my($ret) = defined $a ? $a : "";
@@ -113,13 +114,18 @@ First of all, I\'d like to create this directory. Where?
$default = $cpan_home;
while ($ans = prompt("CPAN build and cache directory?",$default)) {
- File::Path::mkpath($ans); # dies if it can't
- if (-d $ans && -w _) {
- last;
- } else {
- warn "Couldn't find directory $ans
+ eval { File::Path::mkpath($ans); }; # dies if it can't
+ if ($@) {
+ warn "Couldn't create directory $ans.
+Please retry.\n";
+ next;
+ }
+ if (-d $ans && -w _) {
+ last;
+ } else {
+ warn "Couldn't find directory $ans
or directory is not writable. Please retry.\n";
- }
+ }
}
$CPAN::Config->{cpan_home} = $ans;
@@ -353,16 +359,25 @@ sub conf_sites {
require File::Copy;
File::Copy::copy($m,$mby) or die "Could not update $mby: $!";
}
- if ( ! -f $mby ){
- print qq{You have no $mby
+ while () {
+ if ( ! -f $mby ){
+ print qq{You have no $mby
I\'m trying to fetch one
};
- $mby = CPAN::FTP->localize($m,$mby,3);
- } elsif (-M $mby > 30 ) {
- print qq{Your $mby is older than 30 days,
+ $mby = CPAN::FTP->localize($m,$mby,3);
+ } elsif (-M $mby > 30 ) {
+ print qq{Your $mby is older than 30 days,
I\'m trying to fetch one
};
- $mby = CPAN::FTP->localize($m,$mby,3);
+ $mby = CPAN::FTP->localize($m,$mby,3);
+ } elsif (-s $mby == 0) {
+ print qq{You have an empty $mby,
+ I\'m trying to fetch one
+};
+ $mby = CPAN::FTP->localize($m,$mby,3);
+ } else {
+ last;
+ }
}
read_mirrored_by($mby);
}
diff --git a/lib/CPAN/Nox.pm b/lib/CPAN/Nox.pm
index c4016a44ac..e9cb189f29 100644
--- a/lib/CPAN/Nox.pm
+++ b/lib/CPAN/Nox.pm
@@ -1,7 +1,10 @@
+package CPAN::Nox;
+
BEGIN{$CPAN::Suppress_readline=1 unless defined $CPAN::term;}
use CPAN;
+$VERSION = "1.00";
$CPAN::META->has_inst('MD5','no');
$CPAN::META->has_inst('LWP','no');
$CPAN::META->has_inst('Compress::Zlib','no');