Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Dist-Zilla CPAN distribution.

Report information
The Basics
Id: 55718
Status: resolved
Priority: 0/
Queue: Dist-Zilla

People
Owner: Nobody in particular
Requestors: dagolden [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Support dotted decimal versions
Someone is going to want it. Eventually, version numbers should be checked with version::is_lax(), but not until J Peacock releases a version.pm that includes it. -- David
Seems a bit silly that CPAN::Meta can't have a vX.Y.Z version, so here's a patch so Dist::Zilla allows vX.Y.Z, and doesn't complain its not a number. It also will no longer complain about alpha versions (X.Y_Z or vX.Y_Z) nor integer versions (ie. 20100421). Finally, the "not a version" warning has been changed to both display the offending version and stop referring to it as a number.
Subject: 0001-Allow-vX.Y.Z-versions.patch
From a6f6535de71d71d8244dd7cdd15c2e18b89ca69c Mon Sep 17 00:00:00 2001 From: Michael G. Schwern <schwern@pobox.com> Date: Wed, 21 Apr 2010 15:20:23 +0300 Subject: [PATCH] Allow vX.Y.Z versions. Do not warn about vX.Y.Z, integer or alpha versions. Change the version warning to include the offending version and stop referring to it as a number. --- lib/Dist/Zilla.pm | 4 ++-- lib/Dist/Zilla/Plugin/PkgVersion.pm | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Dist/Zilla.pm b/lib/Dist/Zilla.pm index 49f0af1..1da1703 100644 --- a/lib/Dist/Zilla.pm +++ b/lib/Dist/Zilla.pm @@ -77,8 +77,8 @@ sub _build_version { $self->log_fatal('no version was ever set') unless defined $version; - $self->log("warning: version number does not look like a number") - unless $version =~ m{\A\d+(?:\.\d+)\z}; + $self->log("warning: version $version does not look like a version") + unless $version =~ m{\A v? \d+ (?:\.\d+)* (?:_\d+)? \z}x; $version; } diff --git a/lib/Dist/Zilla/Plugin/PkgVersion.pm b/lib/Dist/Zilla/Plugin/PkgVersion.pm index 7f5207a..9df5970 100644 --- a/lib/Dist/Zilla/Plugin/PkgVersion.pm +++ b/lib/Dist/Zilla/Plugin/PkgVersion.pm @@ -36,7 +36,7 @@ sub munge_perl { my ($self, $file) = @_; my $version = $self->zilla->version; - Carp::croak("invalid characters in version") if $version !~ /\A[.0-9_]+\z/; + Carp::croak("invalid characters in version") if $version !~ /\Av?[.0-9_]+\z/; my $content = $file->content; -- 1.7.0.3
Subject: Re: [rt.cpan.org #55718] Support dotted decimal versions
Date: Wed, 21 Apr 2010 08:39:43 -0400
To: Michael G Schwern via RT <bug-Dist-Zilla [...] rt.cpan.org>
From: Ricardo Signes <rjbs [...] cpan.org>
* Michael G Schwern via RT <bug-Dist-Zilla@rt.cpan.org> [2010-04-21T08:28:13] Show quoted text
> Seems a bit silly that CPAN::Meta can't have a vX.Y.Z version, so here's > a patch so Dist::Zilla allows vX.Y.Z, and doesn't complain its not a number.
Thanks. I've actually been waiting for John Peacock to release version 0.82, which has a public routine for "is this a version string we can handle"? I'll be using that, which should address all of this without having our own regex. (It finally came out yesterday or so!) -- rjbs
this was fixed when version 0.82 was released -- rjbs