Update semver_dialects gem to support caret parsing for rpm
Why are we doing this work
This issue is to add support for rpm caret parsing in semver_dialects.
Update semver_dialects gem to support rpm opera... (#428941 - closed) added rpm support for semver_dialects but excluded the caret parsing logic since it is not commonly used in rpm versions and it made the implementation complicated. It is based on go-rpm-version which also excludes caret parsing.
My suggestion is to reference the rpmvercmp logic as closely as possible to ensure that all cases are covered.
These are some useful reference of the rpm versioning:
- Description of how caret sorting works in rpm https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/
- rpm implementation, use this as the source of truth https://github.com/rpm-software-management/rpm/blob/master/rpmio/rpmvercmp.c
- rpm documentation of versioning https://github.com/rpm-software-management/rpm/blob/master/docs/manual/dependencies.md#versioning
Relevant links
- Update semver_dialects gem to support rpm opera... (#428941 - closed)
- Contribute to go-rpm-version to include caret p... (#459971)
Non-functional requirements
-
Documentation: -
Feature flag: -
Performance: -
Testing:
Implementation plan
- Refactor semver_dialects's rpm parser to match the rpmvercpm implementation closely and include logic to parse the caret character
- Uncomment the test cases that includes caret and ensure they are passing
Verification steps
Edited by Shao Ming Tan