Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions doc/ALGORITHM.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

* **PRE_RELEASE** - known pre-release keyword (`alpha`, `beta`, `pre`, `rc`).
* **ZERO** - numeric component equal to zero.
* **POST_RELEASE** - known post-release keyword (`patch`, `post`, `pl`).
* **POST_RELEASE** - known post-release keyword (`errata`, `patch`, `post`, `pl`).
* **NONZERO** - numeric component not equal to zero.

* Unclassified alphabetic components are assigned **PRE_RELEASE**
Expand All @@ -21,8 +21,10 @@
A special case exists for alphabetic component which follows
numeric component, and is not followed by another numeric
component after a delimiter (`1.0a`, `1.0a.1`, but not `1.0a1`
because of lack of delimiter). Such alphabetic component is
assigned a different rank, **LETTER_SUFFIX**, which follows
because of lack of delimiter). In other words, if the previous
component is numeric, the current component is alphabetic,
and the next component is not numeric. Such alphabetic component
is assigned a different rank, **LETTER_SUFFIX**, which follows
**NONZERO** (choice of this behavior explained below).

3. Versions are compared component-wise.
Expand Down Expand Up @@ -135,7 +137,8 @@ any other rank, and to tweak version padding algorithm to use these
instead of `0` filler. This way for a given version a component sequence
would be produced which always compares less than or greater than
(correspondingly) any natural post-or pre-release version with the
same prefix.
same prefix. Note that if a bound is requested, at least one unit
of padding will be added, even if the versions are the same length.

This is implemented in libversion with `VERSIONFLAG_LOWER_BOUND`
and `VERSIONFLAG_UPPER_BOUND` flags.