module OASISVersion:sig..end
Version comparisons
This module handles versions and version comparators. A version is a string of the form "1.0.0". We compare integer and non-integer parts between to version to order them. Version comparators defined relations to a set of version. E.g. ">= 1.0.0" is a version comparator and defines all version above "1.0.0", including "1.0.0".
The version comparison is done using Debian policy for version.
type t
val version_compare : t -> t -> intCompare versions.
val version_of_string : string -> tConvert a string to version.
val string_of_version : t -> stringConvert a version to string.
val value : t OASISValues.tVersion number value. Not exported.
val odn_of_t : t -> OASISDataNotation.tDump OASISDataNotation.t. Not exported.
val chop : t -> tRemove the last part of a version, after the last '.'. I.e. 0.2.0~alpha1 -> 0.2.
type comparator =
| |
VGreater of |
| |
VGreaterEqual of |
| |
VEqual of |
| |
VLesser of |
| |
VLesserEqual of |
| |
VOr of |
| |
VAnd of |
val comparator_apply : t -> comparator -> boolApply version comparator expression.
val string_of_comparator : comparator -> stringConvert a comparator to string. Example of output ">= 3.12.1".
val varname_of_comparator : comparator -> stringConvert a comparator to variable name.
val comparator_of_string : string -> comparatorConvert a string to comparator. Not exported.
val comparator_reduce : comparator -> comparatorSimplify comparator, if possible. Not exported.
val comparator_value : comparator OASISValues.tCheck that we have a version constraint. Not exported.
val odn_of_comparator : comparator -> OASISDataNotation.tDump OASISDataNotation.t. Not exported.
module StringVersion:sig..end
The module OASISVersion.StringVersion uses string for version.