-
Notifications
You must be signed in to change notification settings - Fork 14
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
.pack installation failure #80
Comments
As far as I can see, this seems to be a bug. Hopefully this is not due to the fact that the version 2.0.0-alpha.0.5 uses dots after the dash, which is compliant to the Semantic Version format. |
Maybe linked to Open-CMSIS-Pack/devtools#329 ? |
This does seem like a bug parsing the file name, I'm still investigating |
I see. I guess we must not read the version backwards from the last "." prior to the file extension (*.pack *.zip). |
OK, I think I have found the reason. Cpackget uses the regex for semantic versioning from packIndexFile spec and I have figured that it is matching more than it should: From the regex in PackIndexFile spec, this is the pattern snippet for the "quality" part of the version (note that there is 3 capturing groups, but the last matches many due to "*", causing it to generate a variable number of matches):
Running it against "-alpha.0.5" will generate 4 matches: "-", "alpha", ".0" and ".5" (https://regex101.com/r/BO76pa). Now take a look at the same regex snippet from Semver.org:
The extra Cpackget uses this regex to both match a given pack version and also to separate it from the pack name. The latter was buggy because of the uncertain number of matches that the regex could generate. After swapping the regex to Semver.org one, the bug was fixed! I'll be sending a PR soon. @jeromecoutant I don't think this is related to Open-CMSIS-Pack/devtools#329 because from what I read briefly the piece of code in packchk, it does not use regex for parsing semantic version. |
@chaws thanks a lot for the investigation. Could you please also raise a PR against the PACK.xsd to get the expression there to match the one from semver.org. Please include a link in the comment which reference you have been using. |
@jkrech Open-CMSIS-Pack/Open-CMSIS-Pack-Spec#123, I could not find a way to test if things break with the change though. Oops, scratch that. I saw CI at work :) I'll fix the PR |
I have merged the bugfix for this issue. I will rollout a new release of cpackget next week. |
And:
The text was updated successfully, but these errors were encountered: