Skip Menu |

This queue is for tickets about the version CPAN distribution.

Report information
The Basics
Id: 30056
Status: resolved
Priority: 0/
Queue: version

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

Bug Information
Severity: Critical
Broken in: 0.7203
Fixed in: (no value)



Subject: Version.pm thinks it's own version is uptodate when it isn't
Hi, it seems that the version comparison in version.pm doesn't quite work the way it should. Using version.pm's own version comparison, it thinks that 0.7203 (last dev release $VERSION string) is a more recent release than 0.73 (latest stable). In fact, more oddities happen when we try variations thereof: # it's a smaller version with one 0, but not with 2? $ perl -Mversion -le'print qv("0.720")<=("0.73")' 1 $ perl -Mversion -le'print qv("0.7200")<=("0.73")' # if both use two 0s, it's not smaller? $ perl -Mversion -le'print qv("0.7200")<=("0.7300")' $ perl -Mversion -le'print qv("0.7203")<=("0.73")' # surely 0.7399 is bigger in any respect? $ perl -Mversion -le'print qv("0.7203")<=("0.7399")' $ Currently this stops version.pm (and modules using similar versioning schemes) being updated on any CPAN/CPANPLUS that uses version.pm to detect uptodateness. For CPANPLUS, this is now the default with the new Module::Load::Conditional, which is also part of 5.10.
Sorry, mate a typo in my test cases. This is the ones that have the real issue: # only not uptodate if equal amount of digits are used after the . $ perl -Mversion -le'print qv("0.7203")<=qv("0.73")' $ perl -Mversion -le'print qv("0.7203")<=qv("0.730")' $ perl -Mversion -le'print qv("0.7203")<=qv("0.7300")' 1 # same here $ perl -Mversion -le'print qv("0.720")<=qv("0.73")' $ perl -Mversion -le'print qv("0.72")<=qv("0.73")' 1 $ perl -Mversion -le'print qv("0.720")<=qv("0.730")' 1 # same here $ perl -Mversion -le'print qv("0.7200")<=qv("0.730")' $ perl -Mversion -le'print qv("0.7200")<=qv("0.7300")' 1 $
Subject: Re: [rt.cpan.org #30056] Version.pm thinks it's own version is uptodate when it isn't
Date: Wed, 17 Oct 2007 09:09:27 -0400
To: bug-version [...] rt.cpan.org
From: John Peacock <john.peacock [...] havurah-software.org>
via RT wrote: Show quoted text
> Using version.pm's own version comparison, it thinks that 0.7203 (last dev release $VERSION > string) is a more recent release than 0.73 (latest stable).
No it doesn't: $ perl -Mversion -le'print version->new("0.7203")<=("0.73")' 1 Show quoted text
> > In fact, more oddities happen when we try variations thereof: > > # it's a smaller version with one 0, but not with 2? > $ perl -Mversion -le'print qv("0.720")<=("0.73")' > 1 > $ perl -Mversion -le'print qv("0.7200")<=("0.73")' >
qv() is *not* a generic version object creator. It forces "quoted" version processing where the object creator would normally not do so. In particular, it permits you to have more than 3 digits between subversions, which is why your second example fails (7200 > 730): $ perl -Mversion -MData::Dumper -le'print Dumper(qv("0.7203"))' $VAR1 = bless( { 'original' => 'v0.7203', 'qv' => 1, 'version' => [ 0, 7203, 0 ] }, 'version' ); $ perl -Mversion -MData::Dumper -le'print Dumper(version->new("0.7203"))' $VAR1 = bless( { 'original' => '0.7203', 'version' => [ 0, 720, 300 ] }, 'version' ); If Module::Load::Conditional is using qv() when it should be using version->new(), that is a *big* problem. I wish you had mentioned #29348 to me at the time, so I could have helped you DTRT. I'll respond on that ticket instead of here... John
Subject: Re: [rt.cpan.org #30056] Version.pm thinks it's own version is uptodate when it isn't
Date: Wed, 17 Oct 2007 16:12:23 +0200
To: bug-version [...] rt.cpan.org
From: "Jos I. Boumans" <KANE [...] cpan.org>
Hi John, On 17 Oct 2007, at 15:11, John Peacock via RT wrote: Show quoted text
> If Module::Load::Conditional is using qv() when it should be using > version->new(), that is a *big* problem. I wish you had mentioned > #29348 to me at the time, so I could have helped you DTRT. I'll > respond > on that ticket instead of here...
Sorry, the intricacies between qv() and version->new() aren't obvious to me. Judging by the test case added in that ticket, it seemed to be doing the right thing, but apparently it's not. Thanks for explaining. Feel free to close this ticket, and we'll pick it up in #29348. Cheers, -- Jos Boumans How do I prove I'm not crazy to people who are?