From d87737098aa3752eef064f4ae46efc75f2e59d80 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Fri, 1 Dec 2000 20:36:51 +0000 Subject: =?UTF-8?q?Upgrade=20to=20CPAN=201.59=5F51,=20from=20Andreas=20K?= =?UTF-8?q?=C3=B6nig.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit p4raw-id: //depot/perl@7946 --- lib/CPAN/FirstTime.pm | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'lib/CPAN') diff --git a/lib/CPAN/FirstTime.pm b/lib/CPAN/FirstTime.pm index 6548a3fd7d..7cf01cd20c 100644 --- a/lib/CPAN/FirstTime.pm +++ b/lib/CPAN/FirstTime.pm @@ -17,7 +17,7 @@ use FileHandle (); use File::Basename (); use File::Path (); use vars qw($VERSION); -$VERSION = substr q$Revision: 1.50 $, 10; +$VERSION = substr q$Revision: 1.51 $, 10; =head1 NAME @@ -421,8 +421,26 @@ sub conf_sites { } my $loopcount = 0; local $^T = time; + my $overwrite_local = 0; + if ($mby && -f $mby && -M _ <= 60 && -s _ > 0) { + my $mtime = localtime((stat _)[9]); + my $prompt = qq{Found $mby as of $mtime + + I\'d use that as a database of CPAN sites. If that is OK for you, + please answer 'y', but if you want me to get a new database now, + please answer 'n' to the following question. + + Shall I use the local database in $mby?}; + my $ans = prompt($prompt,"y"); + $overwrite_local = 1 unless $ans =~ /^y/i; + } while ($mby) { - if ( ! -f $mby ){ + if ($overwrite_local) { + print qq{Trying to overwrite $mby +}; + $mby = CPAN::FTP->localize($m,$mby,3); + $overwrite_local = 0; + } elsif ( ! -f $mby ){ print qq{You have no $mby I\'m trying to fetch one }; -- cgit v1.2.1