The other day I asked your wisdom Which CPAN modules are available on platform X?. As it turns out I am not the first one to seek that information as Acme has already released Module::Packaged.

So yesterday I had some spare time and wrote Module::Packaged::Report that generates this report about Perl modules in distributions

There are several further issues where the monks could help, namely creating the same thing for various Unix systems and including the data from ActiveState.

I wrote a bit more in detail about this in my blog in case you are really bored.

Replies are listed 'Best First'.
Re: Perl Modules in distributions
by Binford (Sexton) on May 01, 2007 at 17:55 UTC
    I would like to see this expanded to include the more 'Enterprise' distro's (namely RHES345). Otherwise, nice job.
      As a courtesy you could find the source where I could fetch the list of all the packages in those distros. I'll do the rest.
Re: Perl Modules in distributions
by Anonymous Monk on May 06, 2007 at 11:45 UTC
    A quick check on Mandriva 2007.1 gives a number between:
    $ urpmq -y perl|sort -u|wc -l
    1249
    and
    $ urpmf --provides perl|awk -F: '{print $2}'|sort -u|wc -l
    2929
    depending how you count.

    Module::Packaged should rather use the Mandriva primary mirror (http://carroll.cac.psu.edu/pub/linux/distributions/mandrivalinux/official/), and maybe use the "current" distro (which at present is a symlink to 2007.0). Also, Module::Packaged is only counting the "main" repo in the release, not contrib (which has more perl modules than main).

    Module::Packaged::Generate checks the module names it finds in packages with a name matching perl-(.*)-(.*?)-\d+mdk (note that the package suffix has changed to mdv<distro_release>, e.g. mdv2007.1, but packages which have not required a rebuild since the release of 2006 may still have the old suffix), and discards them if there is not a matching package on CPAN. However, the Mandriva perl packaging policy is to name the package perl-<upstream_tarball_name>, so e.g. we ship perl-ldap (not perl-Net-LDAP). I'm not sure if this was handled correctly or not.

    Also, since some perl modules have names that exceed the allowable length of an rpm package name (e.g. perl-Catalyst-Plugin-Authentication-Store-LDAP), some packages are abbreviated (perl-Catalyst-P-A-Store-LDAP). As such, it may be better to use the provides fields of the packages (which are automatically generated), e.g.:

    $ rpm -q --provides perl-Catalyst-P-A-Store-LDAP
    perl-Catalyst-Plugin-Authentication-Store-LDAP
    perl(Catalyst::Plugin::Authentication::Store::LDAP)
    perl(Catalyst::Plugin::Authentication::Store::LDAP::Backend)
    perl(Catalyst::Plugin::Authentication::Store::LDAP::User)
    perl-Catalyst-P-A-Store-LDAP = 0.04-4mdv2007.0

    So, if these would be more accurate (and not result in duplicates), it might be better to use URPM (I was under the impression it was on CPAN) or some of the MDV::* or Youri::* tools (which are).

    Anyway, I'll see if I can answer some of these questions myself, and maybe provide patches for Module::Packaged (and maybe even support RHEL{2,3,4} as well).