Calling
$index->index();
will start the indexing procedure. Various messages detailing the progress will written to STDOUT, which
by default will be captured into a file cpan_sqlite_log.dddddddddd, where the extension is the "time"
that the method was invoked. Error messages are not captured, and will appear in STDERR.
The steps of the indexing procedure are as follows.
• download existing pre-compiled index (optional)
If CPAN_SQLITE_DOWNLOAD or CPAN_SQLITE_DOWNLOAD_URL variables are set, an already existing and up-to-
date cpandb.sql file will be downloaded from either specified URL or
http://cpansqlite.trouchelle.com/ where it's updated every hour. This greatly increases performance
and decreases CPU and memory consumption during the indexing process but if your CPAN mirror is out-
of-sync or you're using DarkPAN, it obviously wouldn't work. It also wouldn't work without an
internet connection.
See WWW::CPAN::SQLite if you want to setup your own service for pre-compiling the database.
If neither variable is set, this step is skipped.
• fetch index data
The necessary CPAN index files $CPAN/authors/01mailrc.txt.gz and
$CPAN/modules/02packages.details.txt.gz will be fetched from the CPAN mirror specified by the $cpan
variable at the beginning of CPAN::SQLite::Index. If you are using this option, it is recommended to
use the same CPAN mirror with subsequent updates, to ensure consistency of the database. As well, the
information on the locations of the CPAN mirrors used for Template-Toolkit and GeoIP is written.
• get index information
Information from the CPAN indices is extracted through CPAN::SQLite::Info.
• get state information
Unless the "setup" argument within the "new" method of CPAN::SQLite::Index is specified, this will
get information on the state of the database through CPAN::SQLite::State. A comparison is then made
between this information and that gathered from the CPAN indices, and if there's a discrepancy in
some items, those items are marked for either insertion, updating, or deletion, as appropriate.
• populate the database
At this stage the gathered information is used to populate the database, through
CPAN::SQLite::Populate, either inserting new items, updating existing ones, or deleting obsolete
items.