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

I maintain a large-ish tree of perl modules that I keep in git, it's arranged as such:

modules/Some-Module
modules/Some-Other-Module
...

I have scripts to go to each directory and do the basic perl Makefile.PL; make all dist which builds a .tar.gz package.

My problem is that after I have all those .tar.gz packages, and since some of the packages may depend on other packages they have to be installed in a particular order.

Currently I'm doing this by keeping a manual list of the order in which they should be installed. I then do:

    cpanp -i file://$(pwd)/$module_name-$module_version.tar.gz

on each of them in the correct order. I'd rather have my tools (preferrably CPANPLUS) handle dependency resolution for me.

I used to have a solution for this when I used CPAN.pm by running my own CPAN mirror with CPAN::Mini and using CPAN::Mini::Inject to inject all my packages into it before installing them. But maintaining that setup was even more painful than manually maintaining a list of which order they should be installed in.

  • Comment on How do I get CPANPLUS (or some other tool) to resolve dependencies when installing local .tar.gz packages?

Replies are listed 'Best First'.
Re: How do I get CPANPLUS (or some other tool) to resolve dependencies when installing local .tar.gz packages?
by Anonymous Monk on Dec 04, 2007 at 16:20 UTC
    kane (CPANPLUS author) told me that I can use /cs in the latest version of CPANPLUS to do this, I just did:
    /cs --add file:///path/to/my/modules/
    
    Where /path/to/my/modules contains a bunch of .tar.gz packages.
Re: How do I get CPANPLUS (or some other tool) to resolve dependencies when installing local .tar.gz packages?
by jettero (Monsignor) on Dec 04, 2007 at 16:26 UTC
    I guess you can type cpan . as of 1.9xx (not totally sure about the version, but it's kinda new).

    Well, I should say you have to untar it ...

    ( tar -zxvvf package.tar.gz cd package* && cpan . )

    (I've gone and assumed a dash/bash/sh type shell.)

    Oh, no, I missed that the local packages depend on eachother. :( There probably is a way to do that, but I don't know it. I did get a Bundle::JetsFavorites to work out of my ~/.cpan/ dir once. Perhaps it's a similar process.

    -Paul

      That would install a singe package but wouldn't correctly resolve dependencies for local packages that aren't on the cpan if I understand it correctly.
        No. cpan . resolves all dependencies and installs the distribution in the current directory.