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

Okay, the situation is thus:

You’ve got a build machine with your favourite perl modules set up on it.
You’ve got a production machine with none of your favourite perl modules set up on it.

You want one transferred to the other.

The build and production machines are built from the same base components (eg. Hardware, OS Version, Chipset etc).

What’s the easiest way to transfer the installed modules of the build machine onto the production machine?

Will a directory tree copy do the job?

Your production machine doesn’t have a C compiler on it.

Side Winge + rant’n’rave: Yes it’s a real world scenario and no there won’t be one arriving anytime soon. It’s not a perfect way of slowing up script kiddies but it makes up a small portion of a fairly watertight security policy. C compilers and the latest perl modules are a privilege not a right. :)

Thankyou for you caffeine time.

Replies are listed 'Best First'.
Re: Copying of installed PMs
by cleen (Pilgrim) on Jan 08, 2001 at 08:43 UTC
    build the modules on the build machine, copy the modules into your own path where you know an overwrite wont be made for production updates (IE your home directory), and include that directory in your @INC

      Just be sure to install the packages on the build machine into a directory separate from other things. Then you can just transfer that whole directory tree to the production machine and get all of the modules transfered at once and don't have to worry about finding exactly where things got put.

              - tye (but my friends call me "Tye")
Re: Copying of installed PMs
by Trinary (Pilgrim) on Jan 08, 2001 at 22:09 UTC
    If the platforms are CPAN-able, then autobundle!!! This is really cool, used it the other day to upgrade my perl to 5.6 and get everything installed right. On production machine,
    perl -MCPAN -e shell
    At the prompt, type autobundle.
    Go into ~user/.cpan/Bundle and get Snapshot_2001_date_here_00.pm and copy it into the same dir on production machine. Fire up CPAN on production box, hit install Bundle::Snapshot_2001_date_here_00, and go get lunch. CPAN will install every module that was in the standard @INC dirs into the production source tree, all nice and pretty. Probably best to keep an eye on it, and run it through a couple times to get rid of failed dependancies, as I think it just tries to install everything in alphabetical order. One long run through and a couple quick ones to pick up the stragglers should be sufficient.

    Enjoy!

    Trinary

Re: Copying of installed PMs
by blueAdept (Beadle) on Jan 08, 2001 at 20:04 UTC
    You don't mention the platform..but...

    In the NT world you may be able to use the PPM module included in activestate's distribution. Ideally you could setup your own depot, bundle your modules, and 'use PPM;'(and its various routines) in a script to install/manage your modules. You could use a NT schedule/at command to periodically run thescript ensuring that the modules listed in a text file are installed/current.

    I'm not sure how reliable the PPM module is..I know while using PPM interactively I've run across some quirks/issues, so it may be better to use a cruder/more reliable method. Still worth a mention though.

    toodlez - blueAdept
Find the .packlists
by Anonymous Monk on Jan 09, 2001 at 02:39 UTC
    Most modules should install a .packlist file in the perl lib dir. If you are on a unix/linux platform, do something like:

    for i in `find /usr/lib/perl5 -name .packlist`;do cat >> all_packlists.txt;done


    The use zip like this:

    cat all_packlists.txt | zip -@ -r perl_mod.zip

      oops, that dor loop was wrong:

      >> for i in `find /usr/lib/perl5 -name .packlist`;do cat >> all_packlists.txt;done
      --
      << for i in `find /usr/lib/perl5 -name .packlist`;do cat $i >> all_packlists.txt;done