2 depend or not 2 depend

David Cantrell david at cantrell.org.uk
Thu Feb 4 18:15:56 GMT 2010


On Thu, Feb 04, 2010 at 05:46:46PM +0000, Paulo Edgar Castro wrote:

> Our initial thought was to just run through the motions of the app 
> Makefile which has defined these 148 modules with perl Makefile.PL 
> --defaultdeps && make
> and wait for the modules to install.
> Then the penny droped and we realized that we were getting the latest 
> versions of each module which was not what we wanted.
> ...
> We also though that we could force a specific version of a module 
> installation with for example "install 
> M/MS/MSCHWERN/Test-Simple-0.62.tar.gz"
> But then CPAN would go on installing the latest Test-0.69 when 
> Test-Simple-0.62 explicitly depends on Test-0.66 and thus not ready yet 
> for 0.69.

If you go through the dependency tree backwards - that is, generate your
entire tree, then first install the desired versions of the leaf nodes,
then the desired versions of the twigs they hang off, then the branches
that *they* hang off, and so on - then you should get the right
versions without CPAN.pm screwing it up.

CPANdeps <http://deps.cpantesters.org/> may be of some use, but don't
rely on it exclusively to figure out the dependency hierarchy, for two
reasons:
  * it prunes the tree so that any node only appears once - so if your
    app depends on Foo, which depends on Bar and Baz, which both depend
    on Quux, then it will only show Quux as a dependency of one of Bar
    and Baz and not of both;
  * it gives you a snapshot of *current* dependencies.  If the deps have
    changed between Bar version 1 that you want, and version 3 that's
    currently on the CPAN, it can only show you the data for version 3.

>    * Try to mirror that list using our own bastard version of CPAN with
>      cpansite ?

That's definitely a better idea than doing it by hand, because at least
you only have the pain once - do it by hand this time and you'll have to
do it by hand again next time, but build a tool this time and you can
use the same tool next time.

There's some code here that might be a good starting point:
  http://cp5.6.2an.barnyard.co.uk/

You might also want to talk to Schwern, as he was talking about doing
something similar.

-- 
David Cantrell | even more awesome than a panda-fur coat

       23.5 degrees of axial tilt is the reason for the season


More information about the london.pm mailing list