-
Notifications
You must be signed in to change notification settings - Fork 588
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
SemVerHelper.PreRelease.TryParse cannot parse valid nuget pre-release identifiers #522
Comments
Nice analysis. I'm currently on vacation. Are you interested in sending a pull request for this? |
I'm guessing this is a trivial fix for someone that knows F#. Unfortunately I don't. :( |
SemVerHelper Make Number string instead of int Change Regex accordingly
Changes for fsprojects#522: SemVerHelper.PreRelease.TryParse cannot parse valid nuget pre-release identifiers Make number string option Change regex accordingly. No tests found: Tested via fsi.exe: val x : PreRelease option = Some {Origin = "dev20140819130924"; Name = "dev"; Number = Some "20140819130924";} > let x = PreRelease.TryParse("dev-2014-08-19T130924");; val x : PreRelease option = Some {Origin = "dev-2014-08-19T130924"; Name = "dev"; Number = Some "-2014-08-19T130924";}
I have problems to map the members of PreRelease to the naming inside the spec. |
This reverts commit ad5c8be.
Fixed in #1325 |
The current SemVerHelper.PreRelese parser isn't following the current SemVer spec.
For example this is a valid prerelease string
Beta.7.z.92
that the PreRelease has problems with.This is fine because nuget does not support those either. :)
The Nuget prerelease spec says
Since SemVerHelper:PreRelease.TryParse expects a string followed by an int the following strings cannot be parsed, but they should as nuget will accept them:
dev20140819130924
(the digits are the date + time in ISO8601) order as the number is to large for an int. This is something I really need!dev-2014-08-19T130924
I suggest you remove the int-parsing and just use the regex [0-9A-Za-z-]+ as SemVer spec defines. The spec says that prerelease with only digits should be compared numerically, and identifiers with letters or hyphens should be compared in ascii order. However Nuget specifies ascii sort order so just treating it as a string will be fine.
The text was updated successfully, but these errors were encountered: