CPAN::Index::Loader - Populates the CPAN index SQLite database
This package implements all the functionality required to download the CPAN index data, parse it, and populate the SQLite database file.
Because it involves loading a number of otherwise unneeded modules, this package is not loaded by default with the rest of CPAN::Index, but may be loaded on-demand if needed.
my $loader = CPAN::Index::Loader->new( remote_uri => 'http://search.cpan.org/CPAN', local_dir => '/tmp/cpanindex', );
cache accessor returns a CPAN::Cache object that represents the CPAN cache.
remote_uri accessor return a URI object for the location of the CPAN mirror.
local_dir accessor returns the filesystem path for the root directory of the local CPAN file cache.
my $path = $loader->local_file('01mailrc.txt.gz');
local_file method takes the name of a file in the CPAN and returns the local path to the file.
Returns a path string, or throws an exception on error.
my $path = $loader->local_handle('01mailrc.txt.gz');
local_handle method takes the name of a file in the CPAN and returns an IO::Handle to the file.
load_index takes a single param of the schema to load, locates the three main index files based on the
local_dir path, and then loads the index from those files.
Returns the total number of records added.
CPAN::Index::Loader->load_authors( $schema, $handle );
load_authors method populates the
package table from the CPAN 01mailrc.txt.gz file.
author table in the SQLite database should already be empty before this method is called.
Returns the number of authors added to the database, or throws an exception on error.
CPAN::Index::Loader->load_packages( $schema, $handle );
load_packages method populates the
package table from the CPAN 02packages.details.txt.gz file.
package table in the SQLite database should already be empty before this method is called.
Returns the number of packages added to the database, or throws an exception on error.
Bugs should be reported via the CPAN bug tracker
For other issues, contact the author.
Adam Kennedy <email@example.com>
Parts based on various modules by Leon Brocard <firstname.lastname@example.org>
Copyright (c) 2006 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.