http://qs321.pair.com?node_id=291976


in reply to non-CPAN module distributions

Is this a bad approach? Would it be better to just keep using the source module files (*.pm) directly without modulizing them, and just come up with some way to handle unit tests, rather than use the h2xs-generated framework?

I don't think it's a bad approach - but there are certainly other ways of going about it. For example:

Previously, the mod_perl-driven website that used these modules used "use lib ..." to access the source for the libraries directly so there was no module build process, but in converting them to module distributions, they will each require building with ...

You can get ExtUtils::MakeMaker to do most of the work for you.

With these not being CPAN modules, what is a good way to determine which version of each module is currently installed on a system?

That's what $VERSION is for :-)

Also, what is a good way to handle the build process so that only those modules that have been modified are rebuilt? I can do a CVS update of the module sources on each system, but I need some way to determine which modules need to be re-built and re-installed. I have thought of making a global Makefile (or perl script that does basically the same thing a Makefile would do) to handle this, but am not sure if that's the best approach.

When I go this route this is the structure I use:

AppBundle/ Makefile.PL t/ acceptance_test1.t acceptance_test2.t ... Module1/ Makefile.PL t/ lib/ ... Module2/ Makefile.PL t/ lib/ ...

Where the root Makefile.PL is like this one, and the individual module Makefile.PL files are as you would normally expect.

This allows me to:

In fact I have a hook script that, on commit, does a make test on the application as a whole and mails me if it goes wrong. I'm a Subversion user, but I'm sure it will carry across to CVS.

Hope this makes sense :-)

Replies are listed 'Best First'.
Re: Re: non-CPAN module distributions
by BrowserUk (Patriarch) on Sep 17, 2003 at 02:59 UTC

    Thanks for posting the link to Subversion. I'd never heard of it, but it's now installed and I am a convert!


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
    If I understand your problem, I can solve it! Of course, the same can be said for you.

      Subversion rocks :-)

      Actually, it just occurred that subversion would offer another solution to the separation of tests issue. You could create a separate directory in a subversion repository that had a per-module Makefile.PL and external definition links to the appropriate module and test code from the main directory.

      You could then checkout a module that could be worked on stand alone, and have all changes automatically checked into the main tree.

      No idea if/how you would do this in CVS.