From: Graham Knop Date: Wed, 20 Nov 2013 05:34:55 +0000 (-0500) Subject: don't bake paths if activating already active path X-Git-Tag: v2.000_000~31 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b37e5f4a03fd06e4369c89d257560798cb7c9417;p=p5sagit%2Flocal-lib.git don't bake paths if activating already active path --- diff --git a/lib/local/lib.pm b/lib/local/lib.pm index 17ee058..9a8e93f 100644 --- a/lib/local/lib.pm +++ b/lib/local/lib.pm @@ -237,16 +237,19 @@ sub activate { my @active_lls = $self->active_paths; - if (grep { $_ eq $path } @active_lls) { + if (grep { $_ eq $path } @active_lls[1 .. $#active_lls]) { $self = $self->deactivate($path); } - my %args = ( - bins => [ $self->install_base_bin_path($path), @{$self->bins} ], - libs => [ $self->install_base_perl_path($path), @{$self->libs} ], - inc => [ $self->lib_paths_for($path), @{$self->inc} ], - roots => [ $path, @{$self->roots} ], - ); + my %args; + if (!@active_lls || $active_lls[0] ne $path) { + %args = ( + bins => [ $self->install_base_bin_path($path), @{$self->bins} ], + libs => [ $self->install_base_perl_path($path), @{$self->libs} ], + inc => [ $self->lib_paths_for($path), @{$self->inc} ], + roots => [ $path, @{$self->roots} ], + ); + } $args{extra} = $self->installer_options_for($path);