diff options
Diffstat (limited to 'Master/tlpkg/tlperl/lib/CPAN/CacheMgr.pm')
-rw-r--r-- | Master/tlpkg/tlperl/lib/CPAN/CacheMgr.pm | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/Master/tlpkg/tlperl/lib/CPAN/CacheMgr.pm b/Master/tlpkg/tlperl/lib/CPAN/CacheMgr.pm index 827baeaefdb..b9b4eeb32bf 100644 --- a/Master/tlpkg/tlperl/lib/CPAN/CacheMgr.pm +++ b/Master/tlpkg/tlperl/lib/CPAN/CacheMgr.pm @@ -10,7 +10,7 @@ use File::Find; use vars qw( $VERSION ); -$VERSION = "5.5"; +$VERSION = "5.5001"; package CPAN::CacheMgr; use strict; @@ -189,7 +189,8 @@ sub _clean_cache { #-> sub CPAN::CacheMgr::new ; sub new { - my $class = shift; + my($class,$phase) = @_; + $phase ||= "atstart"; my $time = time; my($debug,$t2); $debug = ""; @@ -199,10 +200,12 @@ sub new { SCAN => $CPAN::Config->{'scan_cache'} || 'atstart', DU => 0 }; + $CPAN::Frontend->mydie("Unknown scan_cache argument: $self->{SCAN}") + unless $self->{SCAN} =~ /never|atstart|atexit/; File::Path::mkpath($self->{ID}); my $dh = DirHandle->new($self->{ID}); bless $self, $class; - $self->scan_cache; + $self->scan_cache($phase); $t2 = time; $debug .= "timing of CacheMgr->new: ".($t2 - $time); $time = $t2; @@ -212,10 +215,9 @@ sub new { #-> sub CPAN::CacheMgr::scan_cache ; sub scan_cache { - my $self = shift; - return if $self->{SCAN} eq 'never'; - $CPAN::Frontend->mydie("Unknown scan_cache argument: $self->{SCAN}") - unless $self->{SCAN} eq 'atstart'; + my ($self, $phase) = @_; + $phase = '' unless defined $phase; + return unless $phase eq $self->{SCAN}; return unless $CPAN::META->{LOCK}; $CPAN::Frontend->myprint( sprintf("Scanning cache %s for sizes\n", |