Module Dose_versioning__Debian

Functions for manipulating and comparing Debian version strings. Compliant with Debian policy version 3.9.2. and Debian developers reference version 3.4.6

Comparing debian version strings

val equal : string -> string -> bool
returns

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.

Decomposing and recomposing debian version strings

type version_analysis =
| Native of string * string * string

epoch,upstream,binnmu

| NonNative of string * string * string * string

epoch,upstream,revision,binnmu

result type of the analysis of a version string. The binNMU part, if present, has been removed from the upstream (if native version) or revision (if non-native vesion).

val decompose : string -> version_analysis

decompose a version string

val compose : version_analysis -> string

recompose a decomposed version string. For all v: equal(v,compose(decompose v)) = true. There may, however, be small syntactic differences between v and compose(decompose v)

val strip_epoch_binnmu : string -> version_analysis

return a version without its epoch and without its binNMU part

val strip_epoch : string -> version_analysis

return a version without its epoch part

val extract_epoch : string -> string

return the epoch component of the version. empty string if none