module Version:Functions for manipulating and comparing Debian version strings. Compliant with Debian policy version 3.9.2. and Debian developers reference version 3.4.6sig
..end
val equal : string -> string -> bool
true
iff the two strings define the same version. Hence,
the result may be true even when the two string differ
syntactically.val compare : string -> string -> int
compare x y
returns 0 if x is eqivalent to y, -1 if x is smaller
than y, and 1 if x is greater than y. This is consistent with
Pervasives.compare
.A version string that contains no dash (hence, no revision) is called native. Otherwise it is called non-native, in this case the revision may be empty (example: "1.2-") or not.
A suffix of the upstream part of a native version, or the suffix
of the revision part of a non-native version, may contain a part
indicating a binary NMU (Debian Developers Reference, section
5.10.2.1). A binary NMU part is of the form "+bN" where N is an
unsigned integer.
type
version_analysis =
| |
Native of |
(* | epoch,upstream,binnmu | *) |
| |
NonNative of |
(* | epoch,upstream,revision,binnmu | *) |
val decompose : string -> version_analysis
val compose : version_analysis -> string
equal(v,compose(decompose v)) = true
. There may, however, be
small syntactic differences between v
and compose(decompose v)
val strip_epoch_binnmu : string -> string
val split : string -> string * string * string * string
decompose
should be used instead.val concat : string * string * string * string -> string
recompose
should be used instead.val normalize : string -> string
strip_epoch_binnmu
should be used instead.