Skip Menu |

This queue is for tickets about the local-lib CPAN distribution.

Report information
The Basics
Id: 64208
Status: resolved
Priority: 0/
Queue: local-lib

People
Owner: Nobody in particular
Requestors: xenoterracide [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: duplicate directories in paths
Date: Fri, 24 Dec 2010 21:50:03 -0600
To: bugs-local-lib [...] rt.cpan.org
From: Caleb Cushing <xenoterracide [...] gmail.com>
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-linux-gnu-thread-multi:/home/ccushing/.usr/lib/perl5:/home/ccushing/.usr/lib/perl5/i686-linux-gnu-thread-multi:/home/ccushing/.usr/lib/perl5 -- Caleb Cushing http://xenoterracide.com
Subject: Re: [rt.cpan.org #64208] duplicate directories in paths
Date: Sat, 25 Dec 2010 05:01:44 -0500
To: Caleb Cushing via RT <bug-local-lib [...] rt.cpan.org>
From: Chris Nehren <apeiron [...] cpan.org>
On Fri, Dec 24, 2010 at 22:50:13 -0500 , Caleb Cushing via RT wrote: Show quoted text
> Fri Dec 24 22:50:12 2010: Request 64208 was acted upon. > Transaction: Ticket created by XENO > Queue: local-lib > Subject: duplicate directories in paths > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: xenoterracide@gmail.com > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=64208 > > > > 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-linux-gnu-thread-multi:/home/ccushing/.usr/lib/perl5:/home/ccushing/.usr/lib/perl5/i686-linux-gnu-thread-multi:/home/ccushing/.usr/lib/perl5
Patches welcome. :) -- Thanks and best regards, Chris Nehren
Subject: Re: [rt.cpan.org #64208] duplicate directories in paths
Date: Sat, 25 Dec 2010 17:10:11 +0100
To: bug-local-lib [...] rt.cpan.org
From: Torsten Raudssus <torsten.raudssus [...] googlemail.com>
On 25.12.2010 04:50, Caleb Cushing via RT wrote: Show quoted text
> 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-linux-gnu-thread-multi:/home/ccushing/.usr/lib/perl5:/home/ccushing/.usr/lib/perl5/i686-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! -- http://www.raudssus.de/
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.
Fixed in 1.008002.