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

It would seem like this would be a common operation, but I havn't seen it on google or here. Up to now, I've been downloading my modules manually, and doing the manual install process. I like to keep all my module sources in a single directory, so I can can quickly look thru them. So I have alot of modules to install when I upgrade to a new Perl version, or want to run multiple versions. I know that CPAN would make this easy, but for 2 reasons, I prefer not to use CPAN.
1. I don't like running semi-automatic scripts as root on the network. + I prefer to see the code in hand first. 2. I like a single directory for sources as opposed to the labrythn of + authors-directories which CPAN uses.
So my idea is to write a script which globs all the module source tarballs, and unpacks, perl Makefile.pl, make, make install, with a series of system commands. I know that I have all the dependencies I need, but I don't know if it will be easy to write a script to auto-check for dependencies, then search the local dir and install it first if it is needed by another package.

So before I try and do this, I wonder if there is a way already, which I'm not familiar with. Such as using CPAN, and feeding it a directory to install from, and a list of what to install, and let it automatically install dependencies when it finds them. Eventually I probably will get a list with the dependent modules at the bottom, and things should go smooth. I've read thru the perldoc CPAN but it seems to be geared to network installs, and wasn't inspired by it. Maybe I have a mental block toward it. :-)

Thanks for any ideas.


I'm not really a human, but I play one on earth. flash japh

Replies are listed 'Best First'.
Re: automated install of modules from local directory
by PodMaster (Abbot) on Apr 04, 2004 at 03:01 UTC
    use Module::CPANTS;
    
    Your other alternative is to do some sourcediving into CPAN/CPANPLUS to see what they do (one thing they do is watch STDERR for specifically formatted error messages).

    You could also check to see if META.yml exists, ie

    use YAML;
    use LWP::Simple;
    my $yaml = get 'http://search.cpan.org/src/LBROCARD/Module-CPANTS-0.20030725/META.yml';
    ...
    
    update: Module::ExtractUse

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

Re: automated install of modules from local directory
by chanio (Priest) on Apr 05, 2004 at 00:05 UTC
    I should try to learn more about PPM's Bundles. I guess that it may group some selected modules in one bundle that would install all of them in one command. It might be useful for such situations as exposed above.
Re: automated install of modules from local directory
by zentara (Cardinal) on Apr 05, 2004 at 00:43 UTC