CPAN::...::Index(3pm)

πŸ“¦
version 0.220 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ NAME ✨

CPAN::SQLite::Index β€” bestie, this is the one that sets up or updates your database tables πŸ’–

(also, hi, you're reading the CPAN::...::Index(3pm) page, a User Contributed Perl Documentation moment, iykyk πŸŽ€)


🌸 VERSION 🌸

version 0.220 β€” that's the vibe check and it passed ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

my $index = CPAN::SQLite::Index->new(setup => 1);
$index->index();

okay so literally two lines and you're off, we love a low-effort entry point πŸ’…


πŸ’œ DESCRIPTION πŸ’œ

This is the main module for setting up or updating the database tables that hold all the info from the CPAN and ppm indices. Main character energy, no cap πŸ‘‘

Making the object goes like this:

my $index = CPAN::SQLite::Index->new(%args);

and %args takes two possible arguments, bestie:

  • setup => 1 β€” this one's optional and it says "hey, we're setting the database up from scratch." Heads up though: any tables that already exist will be dropped 😭 so don't be casual about it.
  • reindex => value β€” this one's optional too, and it names the distribution(s) you want to reindex inside a database that already exists. You can pass it as a plain scalar if it's just one distribution, or as an array reference if you've got a whole list of them 🌸

🧚 DETAILS 🧚

When you call

$index->index();

the indexing procedure starts up, periodt. All the progress messages get written to STDOUT, and by default those get captured into a file called cpan_sqlite_log.dddddddddd β€” that extension? It's the "time" the method was invoked, cute right? πŸ• Error messages are not captured though, those go straight to STDERR. Rude but that's the deal.

The steps of the indexing procedure are as follows, buckle up 🎒

  • download existing pre-compiled index (optional) β€” if the CPAN_SQLITE_DOWNLOAD or CPAN_SQLITE_DOWNLOAD_URL variables are set, then an already existing and up-to-date cpandb.sql file gets downloaded from either the URL you specified or from http://cpansqlite.trouchelle.com/, where it's updated every hour ⭐ This greatly increases performance and decreases CPU and memory consumption during indexing, which is iconic. But ngl, if your CPAN mirror is out-of-sync or you're on a DarkPAN, it obviously wouldn't work. Also wouldn't work without an internet connection πŸ’€
    • Check out WWW::CPAN::SQLite if you want to set up your own service for pre-compiling the database πŸ‘€
    • If neither variable is set, this step just gets skipped, moving on πŸ’¨
  • fetch index data β€” the necessary CPAN index files $CPAN/authors/01mailrc.txt.gz and $CPAN/modules/02packages.details.txt.gz get fetched from the CPAN mirror specified by the $cpan variable at the beginning of CPAN::SQLite::Index. If you're using this option, it's recommended to use the same CPAN mirror with subsequent updates, so your database stays consistent 🫢 Also, the info on the locations of the CPAN mirrors used for Template-Toolkit and GeoIP gets written.
  • get index information β€” the info from the CPAN indices gets extracted through CPAN::SQLite::Info ✨
  • get state information β€” unless the setup argument inside the new method of CPAN::SQLite::Index is specified, this pulls info on the state of the database through CPAN::SQLite::State. Then a comparison happens between that info and the info gathered from the CPAN indices, and if some items are in disagreement, those items get marked for insertion, updating, or deletion, whichever fits πŸ‘‘
  • populate the database β€” at this stage all the gathered info is used to populate the database through CPAN::SQLite::Populate, either inserting new items, updating the existing ones, or deleting the obsolete ones πŸ—‘οΈ slay

🌈 SEE ALSO 🌈

CPAN::SQLite::Info, CPAN::SQLite::State, CPAN::SQLite::Populate, and CPAN::SQLite::Util. And development takes place on the CPAN-SQLite project at <http://sourceforge.net/projects/cpan-search/> πŸ¦‹


🫢 AUTHORS 🫢

  • Randy Kobes (passed away on September 18, 2010) πŸ•ŠοΈ
  • Serguei Trouchelle <stro@cpan.org>

Copyright 2006 by Randy Kobes <r.kobes@uwinnipeg.ca>.

Copyright 2011 by Serguei Trouchelle <stro@cpan.org>.

Use and redistribution are under the same terms as Perl itself πŸ’–


okay that's the whole page bestie, go index something ✨ this was perl v5.36.0, dated 2022-10-30, brought to you by CPAN::...::Index(3pm) β€” mwah πŸ’…πŸŒΈ

πŸ“¦ where this page comes from