[SCM] Debian packaging of dh-make-perl branch, master, updated. debian/0.75-1-19-g2230bf9
Damyan Ivanov
dmn at debian.org
Tue Apr 24 05:20:50 UTC 2012
The following commit has been merged in the master branch:
commit a62b8ba2e3794af3c5e264a1403def9210d368d7
Author: Damyan Ivanov <dmn at debian.org>
Date: Tue Apr 24 08:10:53 2012 +0300
when sanitizing version, avoid changing "2.0" to "2."
Closes: #670188: dh-make-perl: incorrect creation of package version for
PDL-Stats 0.6.0. Thanks to Vincent Danjean.
diff --git a/lib/DhMakePerl/Command/Packaging.pm b/lib/DhMakePerl/Command/Packaging.pm
index 2c3d781..f078ee3 100644
--- a/lib/DhMakePerl/Command/Packaging.pm
+++ b/lib/DhMakePerl/Command/Packaging.pm
@@ -300,7 +300,9 @@ sub sanitize_version {
$ver =~ s/^v//;
$ver =~ s/\.(\d\d\d)(\d\d\d)/.$1.$2/; # 2.003004 -> 2.003.004
- $ver =~ s/\.0+/./g; # 2.003.004 -> 2.3.4
+ $ver =~ s/\.0+(?=\d)/./g; # 2.003.004 -> 2.3.4
+ # but avoid 2.0 -> 2.
+ # or 2.0test -> 2.test
$ver =~ s/[^-.+a-zA-Z0-9]+/-/g;
$ver = "0$ver" unless $ver =~ /^\d/;
diff --git a/t/extract_name_ver.t b/t/extract_name_ver.t
index 1f4f683..bc043fc 100755
--- a/t/extract_name_ver.t
+++ b/t/extract_name_ver.t
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
use strict;
-use Test::More tests => 3;
+use Test::More tests => 5;
use DhMakePerl::Command::make;
use DhMakePerl::Config;
@@ -16,3 +16,11 @@ is($@, "", "Calling extract_name_ver should not die");
is($maker->perlname, "Foo-Bar", "Dist name should be Foo-Bar");
is($maker->version, "1.2.3", "Dist version should be 1.2.3");
+
+$maker->meta( { name => 'Foo::Bar', version => '1.02.00' } );
+
+eval { $maker->extract_name_ver; };
+
+is($@, "", "Calling extract_name_ver should not die");
+
+is($maker->version, "1.2.0", "1.02.00 is cleaned to 1.2.0");
--
Debian packaging of dh-make-perl
More information about the Pkg-perl-cvs-commits
mailing list