Subject: | code rudely added to shell rc file |
Date: | Thu, 14 Jul 2016 07:06:05 +0100 |
To: | bug-CPAN [...] rt.cpan.org |
From: | Zefram <zefram [...] fysh.org> |
I have discovered in my ~/.zshrc file two identical stanzas of which I
was not previously aware, both reading
PATH="/home/zefram/perl5/bin${PATH+:}${PATH}"; export PATH;
PERL5LIB="/home/zefram/perl5/lib/perl5${PERL5LIB+:}${PERL5LIB}"; export PERL5LIB;
PERL_LOCAL_LIB_ROOT="/home/zefram/perl5${PERL_LOCAL_LIB_ROOT+:}${PERL_LOCAL_LIB_ROOT}"; export PERL_LOCAL_LIB_ROOT;
PERL_MB_OPT="--install_base \"/home/zefram/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=/home/zefram/perl5"; export PERL_MM_OPT;
Some research suggests that this kind of code is generated by some version
of local::lib, and that in some circumstances an auto-configuring CPAN.pm
will get this from local::lib and *by default* append it to a shell
rc file. This would then affect me by virtue of automated cpan runs,
which necessarily get all-default behaviour. (I didn't intend to run
CPAN.pm without a CPAN::Config in place, but I think this happened by
accident somewhere.) The practical upshot of this edit to my rc file
is that all cpan installations from subsequently-opened shells fail,
because they're all installing to this bogus ~/perl5 directory, which is
not only the wrong place but necessarily fails when it's shared between
all the binary-incompatible perls that I have installed.
Editing the user's shell rc file is a very rude and hideously broken
default behaviour. Keep your grubby mitts off such files, unless
positively invited by the user.
-zefram