On Sat Dec 25 11:10:30 2010, torsten.raudssus@googlemail.com wrote:
Show quoted text> On 25.12.2010 04:50, Caleb Cushing via RT wrote:
>
> > if I source my shell scripts multiple times, this happens, it
> > shouldn't. paths should be checked to see if the directory is
> already
> > in the path.
> >
> > echo $PERL5LIB
> > /home/ccushing/.usr/lib/perl5/i686-linux-gnu-thread-
>
multi:/home/ccushing/.usr/lib/perl5:/home/ccushing/.usr/lib/perl5/i686-
Show quoted text> linux-gnu-thread-
>
multi:/home/ccushing/.usr/lib/perl5:/home/ccushing/.usr/lib/perl5/i686-
Show quoted text> linux-gnu-thread-multi:/home/ccushing/.usr/lib/perl5
>
> We talked about this a bit on the IRC channel, and we think its not
> good
> if local::lib does this automatically. The reason for this is mostly
> the
> order and the "mission" of local::lib. At first, if you do any system
> that checks for double entries, it could happen that you break
> existing
> stuff. An example on this could be: You have local::lib loaded for
> PATH
> A, then you also load local::lib for PATH B, if you then have any
> reason
> to reload PATH A (and make it the "leading" library), the automatic
> double detection wouldn't load it, in this case PATH B is leading and
> this could bring problems to existing running
> environments.
>
> If you really want it that way, you should make a splitted up package
> (which uses local::lib) OR make an extra parameter into local::lib
> which
> activates it, but it cant be a default behaviour.
>
> Still thanks for the suggestion :).
>
> Bye!
Now that local::lib uses PERL_LOCAL_LIB_ROOT to keep track of its active
instances, and there's code in git that allows for removing local::lib
paths from the environment, I have a suggestion that everyone might find
agreeable, which is this:
1. If you run perl -Mlocal::lib=/foo and /foo isn't in
PERL_LOCAL_LIB_ROOT then local::lib will do the same thing it always
has.
2. If you run perl -Mlocal::lib=/foo and /foo was already the most
recent path activated, then local::lib will take no action, instead of
adding a duplicate entry.
3. If you run perl -Mlocal::lib=/foo and /foo is in PERL_LOCAL_LIB_ROOT,
but a different directory was activated after/"on top of" it, then
local::lib will remove /foo from its current place in the list, and then
add it as the newest item. This includes moving /foo to the head of
PERL5LIB and PATH, and making it the active installation target (using
PERL_MM_OPT / PERL_MB_OPT).
The fact that importing local::lib multiple times with /foo doesn't add
multiple entries for /foo will be compatible with the fact that
importing local::lib --deactivate,/foo would remove all traces of /foo
no matter how many times it appeared anyway.