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

I'm having trouble getting my module (Class::MethodMaker) indexed correctly by CPAN; such that CPAN still grabs 1.12 although 2.04 is now out. I had hoped that adding a META.yml would sort this, but it appears not.

So, I want to:

Any ideas how to achieve this robustly? I was going to have a simple 'VERSION' file with the number, and search-and-replace the files on building, but I can't see a foolproof way to get the indexer to see that.

Replies are listed 'Best First'.
Re: CPAN indexing fu
by Joost (Canon) on Oct 20, 2004 at 20:21 UTC
    Maybe wait a little longer? In my experience it takes about a half to two days for a new module to show up on the CPAN index.

    Anyway, I don't use META.yaml (AFAIK it gets automatically created by the cpan site). what I do is use CVS and put this in my modules:

    our $VERSION = sprintf("%d.%03d", '$Name: $' =~ /(\d+)_(\d+)/,0,0);
    And this in my Makefile.PLs:
    WriteMakefile( # ... 'VERSION_FROM' => 'Module.pm' # filename to get version from # ... );

    Then when I want to make a release, I tag the tree with a version number and some optional stuff:

    > cvs tag v1_23-some-extra-info-that-gets-ignored
    and run my release.sh script:
    #!/bin/sh BUILDDIR=/tmp MODULE=my-distibution-name if [ ! -n "$1" ]; then echo "Use 'release.sh TAGNAME' to make a release"; exit 1; fi cd $BUILDDIR && rm -rf $MODULE && cvs export -r $1 $MODULE && cd $MODULE && perl Makefile.PL && make distcheck && make test && make dist && echo " +All done"

    and presto! The "$Name: $" string in Module.pm will be replaced by "$Name: v1_23-some-extra-info-that-gets-ignored $" and will I have a working release tar ball in my /tmp/ directory.

    By the way: the $Name: $ substitution only works if you check out the tree with the given tag name. One of the reasons for the release.sh script is that I used to forget that.

      AFAIK it gets automatically created by the cpan site
      No. ExtUtils::MakeMaker/Module::Build make those, and they're not used by PAUSE/CPAN.
Re: CPAN indexing fu
by Anonymous Monk on Oct 20, 2004 at 23:34 UTC
Re: CPAN indexing fu
by Anonymous Monk on Oct 20, 2004 at 23:35 UTC