Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: perl modules replication

by bart (Canon)
on Sep 14, 2007 at 11:13 UTC ( [id://638990]=note: print w/replies, xml ) Need Help??


in reply to perl modules replication

You can be more specific in the command to CPAN, and tell it to install a specific version, if it still is on CPAN. For that, you have to prefix it with (at least) the initials of the author plus a slash, specify the distribution name, and don't forget to append ".tar.gz". (The latter is a mistake in the design of the CPAN API, IMO.)

For example:

perl -MCPAN -e install -e shift YVES/MIME-Lite-3.01_05.tar.gz
if you want to install a specific developer version from MIME::Lite.

Note that I passed the module name through @ARGV (with shift) because it's not a bareword. I find it a bit easier than quoting.

I also heard like we can take a snapshot of the CPAN modules installed in the server.

So is that I can copy the snapshot directly to the destination server.

Well, sort of... you can make a list of the currently installed modules using autobundle in the CPAN shell. The result is a Bundle "module", which, if you install it, will install the modules in it; so it's best to weed out all the stuff you don't need, or don't want to touch. (Last I tried, years ago, it tried to reinstall core modules.) I'm not sure it'll indeed try to match up the version. It might: the data is present.

If it doesn then you can still make a script out of the list of items you want, and then you can install them automatically, at least, for the time that version is still on CPAN.

If the architecture is identical, or if the modules don't depend on the architecture, you can indeed make a copy of the file trees for these modules. Better still is to use the directories that make builds when you test or install a module. That's basically what PPM does, too.

It must be possible to automate making a tarball that.

Replies are listed 'Best First'.
Re^2: perl modules replication
by fmerges (Chaplain) on Sep 15, 2007 at 08:01 UTC

    Hi,

    The other day I made an autobundle while doing a backup of a laptop, and I realize that after doing autobundle, besides of creating the Bundle:: file, there was also the modules itself under ~/.cpan/sources/authors/id. So handy for just copying them along with the bundle module.

    Regards,

    fmerges at irc.freenode.net

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2024-04-19 14:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found