On 2004-09-20 10:04:27 -0700, Grant wrote:
> I'm not as concerned with a clean filesystem as I am with using a
> single package management system if I can help it. I'd like to
> 'emerge package' and have any and all perl modules required installed
> as ebuilds. I'm thinking some won't install and be recorded because I
> already have them via CPAN. Is there any way to rebuild these with
> ebuilds even though I already have them? Maybe the method you
> describe is the way to do this?
CPAN isn't a package manager, so to speak. It doesn't provide a way to
uninstall modules once you've installed them (perl -MCPAN -e 'install
My::Module'). This is why I recommend carefully removing files from
/usr/lib/perl5/site_perl.
Otherwise, when you install the modules via Portage, you might run into
problems (depending on the order of your @INC directories). Gentoo's
Perl installation seems to put site_perl in front of vendor_perl:
[19:13:43 dwc@fortuna ~]$ perl -le 'print join "\n", @INC;'
/etc/perl
/usr/lib/perl5/site_perl/5.8.4/i686-linux
/usr/lib/perl5/site_perl/5.8.4
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.4/i686-linux
/usr/lib/perl5/vendor_perl/5.8.4
/usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.4/i686-linux
/usr/lib/perl5/5.8.4
It sounds like there's a good chance that you have two copies of some
modules lying around: one installed via CPAN (which probably lives in
site_perl), and one installed via Portage (which probably lives in
vendor_perl). Note how I said "probably", since CPAN makes it difficult
to know for sure. Once you've removed the CPAN copies, you can be
"safe" by remerging them (but it shouldn't make a difference).
I've polluted several filesystems over the years with modules installed
via CPAN instead of my package manager, and I usually regretted it
later.
> Also, g-cpan.pl didn't work for me with Bundle::InterchangeKitchenSink
> as described here:
>
> http://bugs.gentoo.org/show_bug.cgi?id=64466
>
> It sounds like a very useful tool though.
I haven't used g-cpan.pl to install a CPAN bundle. My guess is that it
chokes on them, but maybe you'll receive confirmation on that bug.
Generally speaking, my method of install Perl modules goes something
like this:
(1) Is it satisfied by Perl core modules, or is it already installed?
Something like:
perl -MFile::Spec -le 'print $File::Spec::VERSION;'
is usually enough to tell me if I already have the module.
(2) Is it available in Portage? Just use 'emerge search' on part of the
module's name, e.g. 'emerge search spec'.
If neither of these is satisfied, I try g-cpan.pl. Occasionally I'll
write my own ebuild and place it in my overlay. The perl-module eclass
makes it very easy.
For CPAN bundles, you can take a look at what modules it requires and
try steps (1) and (2) for each of the modules. You can use
http://search.cpan.org/ to see the list of modules required for a
bundle.
--
Daniel Westermann-Clark
--
gentoo-user@gentoo.org mailing list