Just another Perl shrine | |
PerlMonks |
Maintaining CPAN sources for later installation across multiple serversby mp (Deacon) |
on Mar 04, 2003 at 19:58 UTC ( [id://240429]=perlquestion: print w/replies, xml ) | Need Help?? |
mp has asked for the wisdom of the Perl Monks concerning the following question:
The basic problem is this. I am maintaining several servers, one for development and several for production, and I am fairly heavily dependent on CPAN modules for this project. I tend NOT to upgrade perl or CPAN modules because of the extensive testing required to ensure that everything still works, though at times I do upgrade particular modules to the most recent version on CPAN. When installing a new module that has not been used on the project previously, I generally want to install the current version that is on CPAN.
Because I may need to bring another server online later to keep up with load or to replace a server that has crashed, and because that server may be running a more recent linux installation, I need a good way to manage old CPAN sources so that I can always rebuild and reinstall all CPAN modules that are being used (for many modules, this will be older versions) from sources with identical version to what are currently being used on the existing servers. The way I see it, I have two primary problems to solve. One is keeping track of which versions are currently (and should be) installed for a particular server. I think there may be a way to do keep a master list as a bundle file, but I'm not sure exactly how to do that, so any pointers would be appreciated. What I'd like to be able to do is have a bundle that tells what versions of all modules to use, what order to install them in, and what version numbers, then be able to just tell CPAN to install that bundle. Is that possible? The second problem is creating and maintaining an archive of the CPAN module sources that I'm actually using. I really don't need all of CPAN, just certain modules, so a sparse mirror containing only those modules would be sufficient.
I have experimented with saving the "*.tar.gz" files off of CPAN for just the modules that I use, then building manually from these (perl Makefile.PL, make, make test, make install). While this is adequate for the perl source itself, it does not seem like the best approach because of the number of modules in use and the time it takes to build them "manually".
I have also thought of keeping a complete CPAN mirror that I only update when I need the latest copy of something (and then possibly only update that particular module while always keeping old versions), then just use CPAN.pm to install from that as needed. It seems that it should not be too difficult to write something (possibly borrowing from merlyn's mini-cpan-mirror maker) to fetch new modules into the archive on demand without disturbing modules that are already there. Rather than maintain a full mirror, it seems like what would be ideal would be to maintain a sparse (in the sense that not every module is present) CPAN mirror and have a script that can fetch a module source on-demand to add to that mirror. I could then point CPAN.pm there and use it for installations on all my servers. Has anyone tried this? Any gotchas? Has anyone else come up with a good solution for all or parts of this? Am I missing something basic that already solves this problem? I'm looking more for general direction that specific code at this point.
Back to
Seekers of Perl Wisdom
|
|