Conversation on irc.perl.org: (#toolchain, IIRC)
<DrHyde> klapperl: CPAN.pm can be astonishingly slow building Metadata
on some of my testers, particularly the netbsd/alpha box, but i don't
consider it to be a problem. if anyone thinks i should be outraged, i
can time it if you like :-)
<klapperl> if memory is low we need DBD::SQLite, this much is known; the
other dangerous thing is to use YAML.pm instead of YAML::{XS,Syck}
So I put in RT#54729 on Strawberry to remind myself to use YAML::XS
[Alias' preference of the XS YAML modules] as the YAML reader for
Strawberry.
I changed the default settings that are put in place, and once I did
that, I had this output the first time the build tried to execute a
script against the new CPAN [when we try and get information on which
modules need upgrading at the beginning, so this is before CPAN::SQLite
is installed on Strawberry - the script in question is attached as
cpan_string.pl, and the ftpstats.yml file is also attached.]:
Loading CPAN...
Loading Storable...
CPAN::SQLite not installed, trying to work without
Fetching with LWP:
http://cpan.dagolden.com/authors/01mailrc.txt.gz
Going to read 'C:\strawberry\cpan\sources\authors\01mailrc.txt.gz'
............................................................................DONE
Fetching with LWP:
http://cpan.dagolden.com/modules/02packages.details.txt.gz
Alert: While trying to 'parse' YAML file
'C:\strawberry\cpan\FTPstats.yml'
with 'YAML::XS' the following error was encountered:
Usage: YAML::XS::LibYAML::Load(yaml_sv) at
C:\strawberry\perl\vendor\lib/YAML/XS.pm line 70.
Again, I'm not claiming that this is necessarily a bug in CPAN.pm, but
it happens to be exposed by it. [It may be a bug in YAML::XS, after all.]
Subject: | FTPstats.yml |
---
history:
- attempts:
- method: dleasy
start: 1266944578.59143
url: &1 !!perl/hash:CPAN::URL
FROM: USER
TEXT: http://cpan.dagolden.com/
end: 1266944580.86358
file: authors/01mailrc.txt.gz
filesize: 166010
start: 1266944578.59031
thesiteurl: *1
Subject: | cpan_string.pl |
print "Loading CPAN...\n";
use CPAN;
CPAN::HandleConfig->load unless $CPAN::Config_loaded++;
$CPAN::Config->{'urllist'} = [ 'http://cpan.dagolden.com/' ];
print "Loading Storable...\n";
use Storable qw(nstore);
my ($module, %seen, %need, @toget);
my @modulelist = CPAN::Shell->expand('Module', '/./');
# Schwartzian transform from CPAN.pm.
my @expand;
@expand = map {
$_->[1]
} sort {
$b->[0] <=> $a->[0]
||
$a->[1]{ID} cmp $b->[1]{ID},
} map {
[$_->_is_representative_module,
$_
]
} @modulelist;
MODULE: for $module (@expand) {
my $file = $module->cpan_file;
# If there's no file to download, skip it.
next MODULE unless defined $file;
$file =~ s{^./../}{};
my $latest = $module->cpan_version;
my $inst_file = $module->inst_file;
my $have;
my $next_MODULE;
eval { # version.pm involved!
if ($inst_file) {
$have = $module->inst_version;
local $^W = 0;
++$next_MODULE unless CPAN::Version->vgt($latest, $have);
# to be pedantic we should probably say:
# && !($have eq "undef" && $latest ne "undef" && $latest gt "");
# to catch the case where CPAN has a version 0 and we have a version undef
} else {
++$next_MODULE;
}
};
next MODULE if $next_MODULE;
if ($@) {
next MODULE;
}
$seen{$file} ||= 0;
next MODULE if $seen{$file}++;
push @toget, $module;
$need{$module->id}++;
}
unless (%need) {
print "All modules are up to date\n";
}
nstore \@toget, 'C:\tmp\output\cpan.info';
print "Completed collecting information on all modules\n";
exit 0;