Test CPANPLUS install on a Debian system
I’m a Perl author working on a Debian unstable system. The great thing about Debian is that a lot of Perl modules are available though Debian packages. I follow Debian way of life to the point that I no longer install my modules (under development) with ‘sudo make install’ (or its Module::Build equivalent).
I’ve often been bitten by weird test errors due to old version of module lingering in /usr/local. Now, I always create Debian package of my modules under development with dh-make-perl.
This way, I avoid installing Perl module in /usr/local and my developement versions are cleaned up when actual package are availalble through Debian unstable. ()
This method has an unfortunate side effect: I never test installation the CPAN way. And Config::Model did fail to install with CPANPLUS.
Now here’s a way to create a barebone Debian chroot with cowbuilder to test CPANPLUS installation.
First create a new chroot:
$ sudo cowbuilder --create --distribution sid
Loging into this chroot (the bindmount option is necessary for cpanp to work correctly) :
$ sudo cowbuilder --login --bindmounts /dev
In the chroot:
Run cpan to configure CPAN:
Hit return to configure CPAN automatically.
Then install your module:
# cpanp i Config::Model
Or, if your module is not yet uploaded:
# cpanp i http://<path-to-tar.gz>
Once you quit, the chroot is restored to its barebone state.
Et voila. I tested full installation with dependencies the CPAN way without mucking up my system.
Many thanks to Christian Kuelker of Cipux project for his comments that enable me to improve Config::Model
All the best