Skip to content

Commit

Permalink
Support v-strings in package versions
Browse files Browse the repository at this point in the history
  • Loading branch information
miyagawa committed May 11, 2012
1 parent 4573f1b commit a333914
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/App/cpanminus/script.pm
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ sub doit {
$module = join '::', grep { $_ } File::Spec->splitdir($dirs), $file;
}

($module, my $version) = split /\~/, $module, 2 if $module =~ /\~[\d\._]+$/;
($module, my $version) = split /\~/, $module, 2 if $module =~ /\~[v\d\._]+$/;
if ($self->{skip_satisfied} or defined $version) {
$self->check_libs;
my($ok, $local) = $self->check_module($module, $version || 0);
Expand Down
9 changes: 9 additions & 0 deletions xt/vstring_pkg.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
use strict;
use Test::More;
use xt::Run;

my $local_lib = "$ENV{PERL_CPANM_HOME}/perl5";
run "-L", $local_lib, "Perl6::Str~v0.0.4";
like last_build_log, qr/installed Perl6-Str-v0\.0\.4/;

done_testing;

0 comments on commit a333914

Please sign in to comment.