neilwatson has asked for the wisdom of the Perl Monks concerning the following question:

I'm attempting to reverse engineer a CPAN site in order to build a small, internal coporate one. It all seems straight forward execpt for the 03modlist.data.gz file. I do not yet understand its contents. Consider the first few lines:
File: 03modlist.data Description: These are the data that are published in the module list, but they may be more recent than the latest posted modulelist. Over time we'll make sure that these data can be used to print the whole part two of the modulelist. Currently this is not the case. Modcount: 3814 Written-By: Id: mldistwatch 699 2006-01-30 15:42:03Z k Date: Fri, 03 Mar 2006 14:33:12 GMT package CPAN::Modulelist; # Usage: print Data::Dumper->new([CPAN::Modulelist->data])->Dump or si +milar # cannot 'use strict', because we normally run under Safe # use strict; sub data { my $result = {}; my $primary = "modid"; for (@$CPAN::Modulelist::data){ my %hash; @hash{@$CPAN::Modulelist::cols} = @$_; $result->{$hash{$primary}} = \%hash; } $result; } $CPAN::Modulelist::cols = [ 'modid', 'statd', 'stats', 'statl', 'stati', 'statp', 'description', 'userid', 'chapterid' ];
What is the purpose of this file?

Neil Watson
watson-wilson.ca

Replies are listed 'Best First'.
Re: Creating a local CPAN server
by timotheus (Novice) on May 04, 2006 at 15:15 UTC
    There's no need to reverse engineer CPAN. A module called CPAN::Mini provides you with everything needed to host a CPAN repository. Once you have the CPAN repo set up, which takes 5/10 minutes, you can then "inject" your own content into it using CPAN::Mini::Inject.
      CPAN::Mini requires a download of about 500MB to setup.

      Neil Watson
      watson-wilson.ca

        That's true, it takes up around 500MB of disk space. However, it's well worth its price per MB. Where are we now, 25/50 cents per GIG?
      While CPAN::Mini does work (although it is not really that mini). CPAN::Mini::Inject will not install:
      root@tor-svn01 ~/.cpan/build/CPAN-Mini-Inject-0.18 $ make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/00.load..........# Testing CPAN::Mini::Inject 0.18 t/00.load..........ok t/add..............ok t/inject...........ok t/loadcfg..........ok t/new..............ok t/parsecfg.........ok t/pod-coverage.....skipped all skipped: Test::Pod::Coverage 0.08 required for testing POD + coverage t/pod..............skipped all skipped: Test::Pod 1.00 required for testing POD t/readlist.........ok t/testremote.......ok t/update_mirror....ok 1/8Can't open file index.html: at t/lib/CPANSer +ver.pm line 14, <DATA> line 16. unable to contact the remote mirror at t/update_mirror.t line 31 # Looks like you planned 8 tests but only ran 1. t/update_mirror....dubious Test returned status 7 (wstat 1792, 0x700) DIED. FAILED tests 2-8 Failed 7/8 tests, 12.50% okay t/writelist........ok t/zz.exceptions....skipped all skipped: Test Exceptions required to test croaks Failed Test Stat Wstat Total Fail Failed List of Failed ---------------------------------------------------------------------- +--------- t/update_mirror.t 7 1792 8 7 87.50% 2-8 3 tests skipped. Failed 1/13 test scripts, 92.31% okay. 7/39 subtests failed, 82.05% ok +ay. make: *** [test_dynamic] Error 29
      There is no index.html file any where in the tar ball.

      Neil Watson
      watson-wilson.ca

        I don't recall having this problem. However, I'd probably skip that test and force the install. Once the module is installed it's just a matter of running something like this to inject your module.
        my $repo = CPAN::Mini::Inject->new; $repo->parsecfg( '/home/httpd/html/cpan/.cpancfg' ); $repo->add( module => $app_name, authorid => $app_owner, version => $app_version, file => "$app_dir/$app_file" ); $repo->writelist; $repo->inject;

      I had already heard about CPAN::Mini. However taking into account the following discussion in this thread, one gathers the idea that however cheap disk space is becoming now, it is not that "mini" after all.

      Is it possible that one cannot easily setup an infrastructure a' la CPAN only for "local" stuff... CPAN::Micro, any?!?

        CPAN::Mini allows you to filter out content. So I suppose you could filter out everything and then just put your stuff to the repository. The down side is that it's not very convenient to switch your CPAN shell from one repository to another.
Re: Creating a local CPAN server
by dragonchild (Archbishop) on May 04, 2006 at 16:03 UTC
    That file exists to list every single .pm file on CPAN and includes every single distro it's contained in and the versions of both the files and the distros. It's HUGE, is Data::Dumper output that gets eval'ed, and is generally a nasty thing to work with.

    My criteria for good software:
    1. Does it work?
    2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?