Skip to content

Keyword Versions

Benjamin Winger requested to merge bmwinger/portmod:keyword_versions into master

Fixes #358 (closed)

Introduces an "external" version type, which is used to refer to non-packaged versions which must not contain revision or epoch versions (since those are packaging concepts). It seemed to make more sense to use a flag rather than creating a separate class (and if necessary for typing purposes, an ExternalVersion class which always sets the external flag could be used). Trying to split up the Version class didn't really fit with the regex-based parsing without duplicating a lot of work.

Also introduces the VersionRange, a comma-separated list of versions, each beginning with an operator and all must match for the a version to be considered in the range. The idea is to use this for #358 (closed) and #359, as well as eventually supporting it in dependency strings. The current implementation lacks the ~ operator, as well as wildcards (also note #298). Operators are currently mandatory, but should be mutually exclusive with wildcards. I'm not sure if we want there to be a "default" operator without either wildcard or explicit operator. Cargo, which is largely the inspiration for this syntax, has a default which is essentially semver-stable (see here), but I don't think it's reasonable to assume that portmod packages use semver.

Missing:

  • integration of the Keyword type
  • Keyword version detection module
  • wildcards
  • documentation
  • priority of multiple keywords (masked -> stable -> testing)
Edited by Benjamin Winger

Merge request reports