Permalink
Browse files

Reapply missing trailing zeros in perl versions.

  • Loading branch information...
1 parent 3249bcd commit 109b25a161cb895bb64b1f7e3b26d3ee245d8a28 @juster committed Jul 6, 2011
Showing with 6 additions and 3 deletions.
  1. +5 −1 lib/CPANPLUS/Dist/Arch.pm
  2. +1 −2 t/01-translate.t
@@ -910,7 +910,11 @@ sub _translate_perl_ver
{
my ($perlver) = @_;
return $perlver unless $perlver =~ /\A(\d+)[.](\d{3})(\d{1,3})\z/;
- return sprintf '%d.%d.%d', $1, $2, $3;
+
+ # Re-apply the missing trailing zeroes.
+ my $patch = $3;
+ $patch .= q{0} x (3 - length($patch));
+ return sprintf '%d.%d.%d', $1, $2, $patch;
}
#---PRIVATE METHOD---
View
@@ -34,7 +34,6 @@ my %pkgname_of =
# An interesting conflict, mentioned by xenoterracide...
'Perl-Version' => 'perl-perl-version',
'version' => 'perl-version',
-
# Test overridden names
'libwww-perl' => 'perl-libwww',
@@ -77,8 +76,8 @@ my %perlpkgver_of =
( '5.006001' => '5.6.1',
'5.6.1' => '5.6.1',
'5.012001' => '5.12.1',
+ '5.01234' => '5.12.340', # accept missing trailing zeros
'5.0123456789' => 5.0123456789, # not 6 decimals? pass through
- '5.01234' => 5.01234,
'.012345' => '.012345', # must have a major ver number
);

0 comments on commit 109b25a

Please sign in to comment.