module Packages:sig
..end
exception IgnorePackage of string
IgnorePackage error message
val parse_name : Common.Format822.field -> Packages_types.name
val parse_version : Common.Format822.field -> Packages_types.version
val parse_vpkg : Common.Format822.field -> Packages_types.vpkg
val parse_vpkglist : Common.Format822.field -> Packages_types.vpkglist
val parse_vpkgformula : Common.Format822.field -> Packages_types.vpkgformula
val parse_archlist : Common.Format822.field -> Packages_types.architecture list
val parse_builddepslist : Common.Format822.field -> Packages_types.builddepslist
val parse_builddepsformula : Common.Format822.field -> Packages_types.builddepsformula
val parse_string : Common.Format822.field -> string
val parse_string_opt : Common.Format822.field -> string option
val parse_string_list : ?rex:Re.re -> Common.Format822.field -> string list
val parse_int : Common.Format822.field -> int
val parse_int_s : Common.Format822.field -> string
val parse_bool : Common.Format822.field -> bool
val parse_bool_s : Common.Format822.field -> string
val lexbuf_wrapper : ((Stdlib.Lexing.lexbuf -> Packages_parser.token) ->
Stdlib.Lexing.lexbuf -> 'a) ->
Common.Format822.field -> 'a
val assoc : string -> Common.Format822.stanza -> Common.Format822.value
val blank_regexp : Re.re
val comma_regexp : Re.re
typeparse_extras_f =
string -> Common.Format822.stanza -> string
Parsing function for extra values. An extra value can only be a string.
Ex. parse_s ?required:true parse_string
val parse_e : (string * parse_extras_f option) list ->
Common.Format822.stanza -> (string * string) list
val parse_s : ?default:'a ->
?required:bool ->
(Common.Format822.field -> 'a) -> string -> Common.Format822.stanza -> 'a
parse_s is a generic function used to extract and parse a field from a
stanza and cast it to a value. ?default
assign a default value if the
field is absent. The function raise ParseError
if ?required
is true
( default false ) and the field is absent and no default is given.
parse_s
gets a parsing function, a label and a stanza and returns the
value associated to the label.
val get_field_value : parse:(string -> Common.Format822.stanza -> 'a) ->
par:Common.Format822.stanza -> field:string * 'a option -> string * 'a
get_field_value is a generic function used to extract and parse values
from a Format822.stanza. It gets a parsing function parse
, a
stanza par
and a tuple field
where the first element is the label
associated to the value to be parsed and the second element is a parsed
value. If the parsed value is not none, the the function returns it
directly together with the associated label. Otherwise the function will
use the parsing function to extract the value from the stanza. This function
is used to initialize a package
object with certains defaults values without
parsing the entire stanza.
class package :?name:string * Packages_types.name option -> ?version:string * Packages_types.version option -> ?installed:string * Packages_types.installed option -> ?depends:string * Packages_types.vpkgformula option -> ?conflicts:string * Packages_types.vpkglist option -> ?provides:string * Packages_types.vpkglist option -> ?recommends:string * Packages_types.vpkgformula option -> ?extras:(string * parse_extras_f option) list *
(string * string) list option -> Common.Format822.stanza ->object
..end
Representation of a PEF package.
val parse_package_stanza : filter:(Common.Format822.stanza -> bool) option ->
extras:(string * (string -> Common.Format822.stanza -> string) option) list ->
Common.Format822.stanza -> package option
val input_raw : ?extras:(string * (string -> Common.Format822.stanza -> string) option) list ->
string list -> package list
Read n files from disk and return the list of all unique packages. Extras have the
same format as in parse_package_stanza
val parse_packages_in : ?filter:(Common.Format822.stanza -> bool) ->
?extras:(string * (string -> Common.Format822.stanza -> string) option) list ->
string -> IO.input -> package list
same as parse_package_stanza
but read packages stanzas from the given IO channel
val input_raw_in : ?extras:(string * (string -> Common.Format822.stanza -> string) option) list ->
IO.input -> package list
input_raw_in
behaves as input_raw
but read the packages stanzas from
the given IO channel
val packages_parser : string ->
(Common.Format822.stanza -> 'package option) ->
Common.Format822.f822_parser -> 'package list