Closed mschilli closed 8 years ago
Yes, because 0.8.0 is equal to 0.008000 in numeric.
On Mon, Aug 3, 2015, 9:57 PM Mike Schilli notifications@github.com wrote:
I know that comparing versions can be tricky, but is it really reasonable to reject version 0.8.0 when someone requires 0.6 and above?
use CPAN::Meta::Requirements; my $build_requires = CPAN::Meta::Requirements->new; $build_requires->add_minimum('Thrift' => '0.6'); if( $build_requires->accepts_module( 'Thrift' => '0.8.0' ) ) { print "yes!\n"; } else { print "nooo ...\n"; }
— Reply to this email directly or view it on GitHub https://github.com/Perl-Toolchain-Gang/CPAN-Meta-Requirements/issues/29.
If 0.8.0 is 0.008000, why isn't 0.6 equal to 0.006 in "numeric"?
0.6.0 is. But 0.6 isn't.
On Mon, Aug 3, 2015, 10:25 PM Mike Schilli notifications@github.com wrote:
If 0.8.0 is 0.008000, why isn't 0.6 equal to 0.006 in "numeric"?
— Reply to this email directly or view it on GitHub https://github.com/Perl-Toolchain-Gang/CPAN-Meta-Requirements/issues/29#issuecomment-127482658 .
So if a module author releases 0.6.1 after 0.6, this will break every module on CPAN requiring 0.5 and above?
Correct. A CPAN dist shouldn't switch version number scheme, at least not in the middle of minor releases.
Read more at http://www.dagolden.com/index.php/369/version-numbers-should-be-boring/
On Mon, Aug 3, 2015, 10:32 PM Mike Schilli notifications@github.com wrote:
So if a module author releases 0.6.1 after 0.6, this will break every module on CPAN requiring 0.5 and above?
— Reply to this email directly or view it on GitHub https://github.com/Perl-Toolchain-Gang/CPAN-Meta-Requirements/issues/29#issuecomment-127483878 .
Okay, I'll fix my dependency on Thrift 0.6 to 0.6.1 and hope that the author won't revert to a two-number scheme. Thanks!
Well, Thrift is still indexed to 0.8.0 rather than the new 0.9.0 release, because its package statement was altered:
https://metacpan.org/source/GSLIN/Thrift-0.9.0//lib/Thrift.pm
Thrift 0.008000 G/GS/GSLIN/Thrift-0.8.0.tar.gz
Thrift::BinaryProtocol 0.009000 G/GS/GSLIN/Thrift-0.9.0.tar.gz
Thrift::BinaryProtocolFactory 0.009000 G/GS/GSLIN/Thrift-0.9.0.tar.gz
Thrift::BufferedTransport 0.009000 G/GS/GSLIN/Thrift-0.9.0.tar.gz
Thrift::BufferedTransportFactory 0.009000 G/GS/GSLIN/Thrift-0.9.0.tar.gz
Thrift::ForkingServer 0.009000 G/GS/GSLIN/Thrift-0.9.0.tar.gz
Thrift::FramedTransport 0.009000 G/GS/GSLIN/Thrift-0.9.0.tar.gz
Thrift::HttpClient 0.009000 G/GS/GSLIN/Thrift-0.9.0.tar.gz
On Mon, Aug 3, 2015 at 10:50 PM, Mike Schilli notifications@github.com wrote:
Okay, I'll fix my dependency on Thrift 0.6 to 0.6.1 and hope that the author won't revert to a two-number scheme. Thanks!
— Reply to this email directly or view it on GitHub https://github.com/Perl-Toolchain-Gang/CPAN-Meta-Requirements/issues/29#issuecomment-127486525 .
Side note: this is why I recommend that people always use a leading v
when doing anything involving version tuples. It's much less confusing when someone drops the last part (as long as they keep the leading v
): v0.6.0
== v0.6
== 0.006
.
I know that comparing versions can be tricky, but is it really reasonable to reject version 0.8.0 when someone requires 0.6 and above?
use CPAN::Meta::Requirements; my $build_requires = CPAN::Meta::Requirements->new; $build_requires->add_minimum('Thrift' => '0.6'); if( $build_requires->accepts_module( 'Thrift' => '0.8.0' ) ) { print "yes!\n"; } else { print "nooo ...\n"; }