Subject: | CPAN::Meta::Converter forces version to '0' when there's no version in "provides" |
Date: | Wed, 27 Mar 2013 20:39:00 -0700 |
To: | bug-CPAN-Meta [...] rt.cpan.org |
From: | Tatsuhiko Miyagawa <miyagawa [...] gmail.com> |
CPAN::Meta->create($struct), upon passing 1.4 and dumps 2.0 or vice
versa, fills the 'version' entry in the 'provides' hash with the value
of '0' when there's no 'version' defined in the .pm file.
Here's a script to demonstrate that failure.
https://gist.github.com/miyagawa/5260366
Background for this bug is that, once you release a module with .pm
files without any $VERSION with Module::Build, it will create
'version' : '0' in META.json file, and PAUSE indexes it with version
'0'.
Then you upload a new distribution with other tools (dzil, Milla etc.)
with a "correct" META.json files with no 'version' entry in the
'provides' hash, PAUSE rejects the upload, since it thinks '0' is
higher than 'undef'. i.e.
http://nopaste.64p.org/entry/C04072B6-9755-11E2-865C-3AC23A9B6EE1
CPAN::Meta::Spec says:
version
This field contains a Version String for the package, if one exists.
so overwriting the value with '0' when there doesn't exist any, is
considered a bug.
CPAN::Meta::Converter's provides_spec should be updated to skip
'version' when it does't exist.
--
Tatsuhiko Miyagawa