Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version numification is incorrect #337

Closed
haarg opened this issue Sep 5, 2014 · 5 comments · Fixed by #339
Closed

version numification is incorrect #337

haarg opened this issue Sep 5, 2014 · 5 comments · Fixed by #339

Comments

@haarg
Copy link
Member

haarg commented Sep 5, 2014

The way versions are numified by metacpan is incorrect.

The correct way to numify a version in perl is:

$version = version->new($version)->numify;
$version =~ s/_//g;

I'm not entirely clear what MetaCPAN::Util::fix_version is attempting to do. For versions with v prefixes, it roughly matches what I described above. But many dotted-decimal form versions don't include the v prefix. They should be handled the same. Additionally, I'm not sure where s/_/00/g came from, but it is certainly wrong.

I can wrote up a PR if I can get fix_version clarified. The git history is unhelpful.

@oalders
Copy link
Member

oalders commented Sep 8, 2014

@monken Any objections to the proposed fix?

@monken
Copy link
Contributor

monken commented Sep 9, 2014

Will this break any of the tests in utils.t?
There are a lot of bogus and broken versions out there. I guess I was working around a few corner cases. We should add the cases from the issues references here to the test and see where it goes.

@haarg
Copy link
Member Author

haarg commented Sep 9, 2014

Some of the existing tests are wrong, so they will need to be corrected.

I started working on a fix for this, but ran into yet another bug in version.pm. I'm not sure yet how I want to deal with it.

@oalders
Copy link
Member

oalders commented Sep 9, 2014

If we don't have https://metacpan.org/pod/XML::Tidy in our list of weird versions to test, we may want to add it.

@karenetheridge
Copy link

On Tue, Sep 09, 2014 at 03:14:35PM -0700, Olaf Alders wrote:

If we don't have https://metacpan.org/pod/XML::Tidy in our list of weird versions to test, we may want to add it.

OMG, it's one of those dists.

FWIW, I just ran this through Module::Metadata and it successfully extracted the version "1.12".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants