David Golden wrote:
Fixed in trunk. All versions supplied to requires, build_requires,
configure_requires, etc. are now normalized if they are a version
object or appear to be a dotted tuple.
The code you committed is actually more complicated than it needs to be:
=== lib/Module/Build/Base.pm
==================================================================
--- lib/Module/Build/Base.pm (revision 2562)
+++ lib/Module/Build/Base.pm (local)
@@ -3620,9 +3620,7 @@
}
elsif ( ref $version eq 'version' ||
ref $version eq 'Module::Build::Version' ) { # version objects
- my $string = $version->stringify;
- # normalize leading-v: "v1.2" -> "v1.2.0"
- $version = substr($string,0,1) eq 'v' ? $version->normal : $string;
+ $version = $version->is_qv ? $version->normal : $version->stringify;
}
elsif ( $version =~ /^[^v][^.]*\.[^.]+\./ ) { # no leading v, multiple dots
# normalize string tuples without "v": "1.2.3" -> "v1.2.3"
Of course I cheated and used the undocumented (until now that is)
$obj->is_qv method, which is true for extended versions (henceforth to
be referred to as dotted-decimal).
I also wonder why you didn't use:
elsif ($version->isa('version') {
which protects against other version.pm-derived classes which would
otherwise continue through unmolested...
John