Skip to content

Commit

Permalink
Don't symlink executables into bin/
Browse files Browse the repository at this point in the history
If we do, "perlbrew use" doesn't work, because when it overrides your path
to "bin/:perls/VERSION/bin", the symlinks in bin/ will take precedence.

bin/ needs to be kept clean of "perl" commands for use to work.

There is one case left: "perlbrew switch /path/to/very/specific/perl"
"perlbrew use" still fails to work with that one.

We also included upgrade notes in the Changes file. We need to

   perlbrew init
   perlbrew off
   perlbrew switch version-you-want

to clean up all the old symblinks.

Signed-off-by: Pedro Melo <melo@simplicidade.org>
  • Loading branch information
melo committed Mar 7, 2011
1 parent a6c35d9 commit 7c918b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
3 changes: 3 additions & 0 deletions Changes
@@ -1,4 +1,7 @@
NEXT:

- UPDATE NOTES: you need to init, off and switch back to the version you want;
- Fix "perlbrew use" to work even if we are switched to a specific version
- Fix "perlbrew env" to use current version, sets PERLBREW_PERL and proper PATH
- Feature: "perlbrew use" shows current version in use

Expand Down
10 changes: 0 additions & 10 deletions lib/App/perlbrew.pm
Expand Up @@ -491,10 +491,6 @@ INSTALL
delete $ENV{$_} for qw(PERL5LIB PERL5OPT);

if (!system($cmd)) {
if ($dist_version =~ /5\.1[13579]|git/) {
$self->run_command_symlink_executables($as);
}

print <<SUCCESS;
Installed $dist as $as successfully. Run the following command to switch to it.
Expand Down Expand Up @@ -607,12 +603,6 @@ sub run_command_switch {
die "${dist} is not installed\n" unless -d "$ROOT/perls/${dist}";
unlink "$ROOT/perls/current";
system "cd $ROOT/perls; ln -s $dist current";
for my $executable (<$ROOT/perls/current/bin/*>) {
my ($name) = $executable =~ m/bin\/(.+?)(5\.\d.*)?$/;
my $target = "$ROOT/bin/${name}";
next unless -l $target || !-e $target;
system("ln -fs $executable $target");
}
}

sub run_command_off {
Expand Down

0 comments on commit 7c918b8

Please sign in to comment.