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

Greetings

Before I sit down and try to write something myself (possibly with the aid of snapdiff/autobundle), can anyone tell me if there is a script "out there" that can be used to synchronise the modules from one machine to another?

What I would like to be able to do is this:

  1. I develop an application that requires a module I don't currently have.
  2. I install the module from CPAN.
  3. Rather than repeating (2) on my laptop, my two web servers and my "doesn't matter if I trash it" machine, run a script to get the same modules installed on all those other machines.
  4. I copy my application to my other machines without having to worry about forgetting to install the modules, thanks to (3).

I humbly await your wisdom...

Replies are listed 'Best First'.
Re: Perl Module (CPAN) Synchronisation
by Roger (Parson) on Sep 29, 2004 at 07:10 UTC
    There are lots of utilities to do directory sync, such as synctree, remsync, etc. I would say the best approach (at least to me) is to install your modules, and then synchronize the perl directories across machines afterwards. What could be tricky is when the machines are of different platform, then you will have to kick off CPAN fetch/build scripts remotely (with secure shell perhaps?).

Re: Perl Module (CPAN) Synchronisation
by steves (Curate) on Sep 29, 2004 at 10:56 UTC

    The CPAN module offers ways to automate package downloads and installs from CPAN. But I've only played with it so I'm not an expert.

    This is something I also want to solve at some point. In my mind, what I want is some sort of master make file I can take to any machine and have it build or upgrade that machine to include everything I need. I'd want that to work cross-platform and I'd want it to get any prerequisite libraries and build those. The model I like best for this is the FreeBSD ports model. If you've never used that, it allows you to install a tree that represents everything you could get for your installation. You can sync up with new versions of that tree. The tree is just a skeleton. If you actually want one of the pieces, you go to its skeleton directory and type make. If other dependencies exist, it automagically gets and builds those. It's a very clean model IMO.

      Thanks for the responses, folks. This confirms, I feel, that there isn't a simple 'turnkey' solution floating around 'out there'.

      I will, therefore, knock up some code myself. I will share when it actually works...

Re: Perl Module (CPAN) Synchronisation
by neeraj (Scribe) on Sep 29, 2004 at 10:58 UTC
    hello i feel rather than synchronizing , you can configure CPAN shell on all your machines and install teh modules with its dependencies on demand. For windows , you can use PPM. Rather than copyinfg the directories and resolving isssues of differant OS, this sounds a better way to me.