diff options
author | Justin Davis <jrcd83@gmail.com> | 2012-07-04 01:55:06 +0200 |
---|---|---|
committer | Justin Davis <jrcd83@gmail.com> | 2012-07-04 01:55:06 +0200 |
commit | 77e3eb9e7b18be9228d1c7c7f2430fd01e58d99a (patch) | |
tree | 4337abc7dd1701ab8484bed29bcb8c0a259bf739 /preps | |
parent | 1f2ddaf1245360f7e10000689afa4ad03650cc23 (diff) | |
download | genpkg-77e3eb9e7b18be9228d1c7c7f2430fd01e58d99a.tar.gz genpkg-77e3eb9e7b18be9228d1c7c7f2430fd01e58d99a.tar.xz |
Strip zeros from dependencies upon the perl package.
Diffstat (limited to 'preps')
-rwxr-xr-x | preps/perl.d/perl-dist | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/preps/perl.d/perl-dist b/preps/perl.d/perl-dist index 748ce11..c6fa2e3 100755 --- a/preps/perl.d/perl-dist +++ b/preps/perl.d/perl-dist @@ -171,12 +171,11 @@ sub _perldepver # Fix perl-style vstrings which have a leading "v". return $perlver if($perlver =~ s/\Av//); - return $perlver unless($perlver =~ /\A(\d+)[.](\d{3})(\d{1,3})\z/); - # Re-apply the missing trailing zeroes. - my $patch = $3; - $patch .= q{0} x (3 - length $patch); - return sprintf('%d.%d.%d', $1, $2, $patch); + my @v; + return $perlver unless(@v = $perlver =~ /\A(\d+)[.](\d{1,3})(\d{0,3})\z/); + pop @v unless($v[2]); + return join q{.}, map { int } @v; # int removes zeroes } #---PUBLIC FUNCNTION--- |