Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

CPAN module

by MCauth (Novice)
on Dec 11, 2000 at 06:00 UTC ( [id://45995]=perlquestion: print w/replies, xml ) Need Help??

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

At work we've got about 15-20 Apache servers to setup, all on Solaris running Perl 5.6. We tried using the autobundle feature of the CPAN module to take a "snapshot" of our currently loaded modules, so we could then just simply install the snapshot and let CPAN.pm do the rest of the work...well, it didn't work out so well. Here's what it did and didn't do:

-- The module couldn't figure out dependencies, and seemed to be working STRICTLY off of the order in which the "snapshot" was taken. This seemed wierd, as it's supposed to be smart enough to figure that out (and does if I let it go to CPAN and fetch the module on it's own). For example, LWP installation would totally hang because of some dependencies it had, which were in fact installed, but further down the list on the snapshot.

-- CPAN.pm re-installed Perl 5.6 itself on our machine. Dunno why, it was already there!

I would really like to use this feature, as I'm the Jr. Admin. and am the one manually installing all the modules on the machines!! I may end up writing a script that'll go through a list of mods that I type up and fetch them from CPAN one by one, but would MUCH rather just use autobundle to ease the pain of multiple installations of the same set of modules. Any advice would be greatly appreciated!
Thanks, Matt

Replies are listed 'Best First'.
Re: CPAN module
by clemburg (Curate) on Dec 11, 2000 at 15:15 UTC

    In a presentation at the Second German Perl Workshop, Andreas König, author of CPAN, gave a talk on his module, mentioning explicitly that you are expected to manage the dependencies in a bundle file yourself. The autobundle feature is merely a convenience to get you started.

    My advice would be to generate a snapshot with the autobundle feature, and then hand-tune it till you like it. Core modules should be avoided, since they will install a new perl (as brother Fastolfe pointed out). You can install core modules *without* installing a new perl by hand-fetching (or building) a distribution tarball for them, and installing that by a local script.

    This trivial subroutine does a simple install from a distribution tarball under Linux/Unix:

    sub install_perl_module { my ($tarball) = @_; my $dir = $tarball; $dir =~ s/\.tar\.gz//; my $cmd = 'tar -zxvf ' . $tarball . ' ; ' . 'pushd ' . $dir . ' ; ' . 'perl Makefile.PL ; make ; make test ; make install ; ' . 'popd'; system($cmd); }

    Christian Lemburg
    Brainbench MVP for Perl
    http://www.brainbench.com

Re: CPAN module
by Fastolfe (Vicar) on Dec 11, 2000 at 07:32 UTC
    Three things to try:

    First, try shifting things around in the bundle list, to put some of the lower-level modules first before you get to the larger ones that use those modules.

    Second, eliminate core modules from your bundle file. Things like IO::Socket are bundled *with* Perl, so if you're telling it to install it, it may be confused and try to install it separately by downloading the parent package that it's installed under (e.g perl_5.6).

    Third, did you let it finish? Perhaps it is keeping track of dependencies and would have tried loading them after the bundle file had been exhausted? Bundle behavior seems to be inconsistent sometimes from what I've read.

Re (tilly) 1: CPAN module
by tilly (Archbishop) on Dec 11, 2000 at 06:22 UTC
    When I went to use the autobundle feature I found it didn't work so well either. It works even worse with an old version of CPAN. However I found that I could get it to be acceptable by taking a snapshot, editing out various modules that caused problems, then running it on the target machine several times so it sorted out dependencies.

    One of the problems is that a bundle is supposed to be presented in a way that already gets dependencies straight. But once everything is installed it is hard to figure that out again.

Re: CPAN module
by coreolyn (Parson) on Dec 12, 2000 at 22:16 UTC

    Here's the sloppy way I attempt to save some time when in the same situation. This answer does not attempt to provide a resolution to the autobundle problems.

    When you setup your cpan module on your 'base' system set it up with a huge cache (I set mine at 200 megs), also on the cache cleaning set it to 'never' I then setup my base perl on the clone system and just move the .cpan directory over. Install cpan.pm and let cpan.pm resovle the dependencies.

    This is a serious cludge fix but it does save me time on a regular basis. There is a significant time saving in not having to dl all the bundles. I should also point out that more than half the time the bundles I have in the cache have been updated so there is still dl time involved.

    coreolyn Duct tape devotee.
    -- That's OO perl, NOT uh-oh perl !-)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://45995]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-16 07:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found