package core_kernel

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type t = {
  1. repo : string;
  2. version : string;
}

t is the structured representation of a single entry from version_list.

val sexp_of_t : t -> Sexplib0.Sexp.t
val parse1 : string -> t Core.Or_error.t

Parse a single line of version-util. It's almost always better to use one of the functions below, because applying this to Version_util.version results in the following weird behaviors:

  • NO_VERSION_UTIL gets parsed repo = "NO_VERSION"; version="UTIL"
  • "repo1_rev1 repo2_rev2" gets parsed as repo = "repo1_rev1 repo2"; version = "rev2"

In the following functions Error _ means the format is unparsable, Ok None means the version is NO_VERSION_UTIL.

val parse_list : string list -> t list option Core.Or_error.t
val parse_lines : string -> t list option Core.Or_error.t
val current_version : unit -> t list option

The _present functions return Error instead of None when there's no version util. There is no version util during most builds.

val parse_list_present : string list -> t list Core.Or_error.t
val parse_lines_present : string -> t list Core.Or_error.t
val current_version_present : unit -> t list Core.Or_error.t
OCaml

Innovation. Community. Security.