in reply to Re: CPANPLUS custom configurations
in thread CPANPLUS custom configurations
A configuration file is any module with a name starting with "CPANPLUS/Config/", relative to the current base directory (by default: $home/.cpanplus on a linux system) or any folder in @INC.
Thanks a lot, works.
But what is interesting (strace-d), if any such module is found in @INC, the same module is also being loaded from $HOME/.cpanplus first, so the one found in @INC has no effect. A bug? A feature?
What is also important, make sure that the package in which the configuration is defined matches the filename, or the configuration will be ignored (possibly with some errors on the console). Seems normal, but may be missed when copying the saved User.pm file to e.g. SomeLocal.pm without changing the package name.
So to sum up with some code, I use custom cpanp configuration for local dir "installations" by starting it in a directory having CPANPLUS/Config/SomeLocal.pm:
package CPANPLUS::Config::SomeLocal; use warnings; use strict; use Cwd; sub setup { my $conf = shift; my $d = getcwd; $conf->set_conf( base => "$d/.cpanplus" ); $conf->set_conf( buildflags => "install_base=$d/perl" ); $conf->set_conf( makemakerflags => "INSTALL_BASE=$d/perl" ); return 1; } 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: CPANPLUS custom configurations
by ig (Vicar) on May 09, 2009 at 03:45 UTC |