[Melbourne-pm] caching CPAN dist files

Toby Corkindale toby.corkindale at strategicdata.com.au
Tue Apr 19 18:27:47 PDT 2011


I install a custom Perl into /usr/local/$NAME/perl, and then install the 
multitude of CPAN modules in there with it using CPANPLUS.

I have a script that can do the above automatically, and can also update 
the CPAN modules.

After everything is in there, I add/update the files to a Git 
repository, then build a Debian package out of the whole lot.

Just a single, monolithic package that contains everything.

Then that gets installed on development and production machines.

If new modules are required, the process is re-run, and a new single 
package is built.. this gets tested in development alongside the next 
upcoming production release, then release to production alongside the 
next release.

This seems to work fairly well; I can't claim that the idea is mine - it 
was inspired by a talk at OSDC a couple of years ago by Adam Kennedy.

I have intentions to get this cleaned up enough to release as an 
open-source project, but it's not quite there yet.

-Toby

On 20/04/11 09:51, Malcolm Herbert wrote:
> I'm in the process of putting together a project that I'm expecting to
> use a fair number of CPAN modules directly rather than using the system
> native packages of them, for portability.  I have a few development and
> test instances and a few instances in production.  I'd like to use CPAN
> to manage the modules installed on each, however I want to make sure
> that they stay in sync with each other and avoid potential dependency
> issues should my development and production environments drift too far
> apart.  Ideally I'd like to use the CPAN tools to update the production
> environment only from the set of modules I've collected and tested on my
> dev/test hosts.
>
> Is there a good method for doing this?  I've discovered Local::lib from
> the Catalyst book which looks promising for installing modules into
> non-system locations which means I can add and update modules without
> being root on the host, but I can't see how to get CPAN to only ever
> look in local directories for dist files rather than fetching from the
> web.
>
> Also, if down the track I discover a need for module xxx, the current
> version of which requires a later yyy than I have (ignoring issues of
> whether this is a good idea) how would I go about trying to locate the
> latest version of xxx that would be satisfied with the version of yyy
> that I already have rather than trying to update both?  How long do old
> versions of modules stick around in CPAN?
>
> I've been able to avoid precisely this issue with pkgsrc by
> pre-emptively downloading all the binary packages as they are available
> in one hit, which has meant I've been able to add new packages to older
> installs of hosts without issues, at the cost of downloading around 10GB
> of data ... do people do similar things with CPAN?  How big is CPAN if I
> were to attempt this?  Are there snapshot versions of CPAN out there
> which don't change (apart from minor bug fixes)?  How long do they last
> in that state?
>
> So many questions ... :)
>
> Regards,
> Malcolm
>


-- 
.signature


More information about the Melbourne-pm mailing list