Module Dose_pef__Packages
Exceptions
Common Parsing Functions
val parse_name : Dose_common.Format822.field -> Dose_pef.Packages_types.nameval parse_version : Dose_common.Format822.field -> Dose_pef.Packages_types.versionval parse_vpkg : Dose_common.Format822.field -> Dose_pef.Packages_types.vpkgval parse_vpkglist : Dose_common.Format822.field -> Dose_pef.Packages_types.vpkglistval parse_vpkgformula : Dose_common.Format822.field -> Dose_pef.Packages_types.vpkgformulaval parse_archlist : Dose_common.Format822.field -> Dose_pef.Packages_types.architecture listval parse_builddepslist : Dose_common.Format822.field -> Dose_pef.Packages_types.builddepslistval parse_builddepsformula : Dose_common.Format822.field -> Dose_pef.Packages_types.builddepsformulaval parse_string : Dose_common.Format822.field -> stringval parse_string_opt : Dose_common.Format822.field -> string optionval parse_string_list : ?rex:Re.re -> Dose_common.Format822.field -> string listval parse_int : Dose_common.Format822.field -> intval parse_int_s : Dose_common.Format822.field -> stringval parse_bool : Dose_common.Format822.field -> boolval parse_bool_s : Dose_common.Format822.field -> string
Generic Parsing Functions
val lexbuf_wrapper : ((Stdlib.Lexing.lexbuf -> Dose_pef.Packages_parser.token) -> Stdlib.Lexing.lexbuf -> 'a) -> Dose_common.Format822.field -> 'aval assoc : string -> Dose_common.Format822.stanza -> Dose_common.Format822.valueval blank_regexp : Re.reval comma_regexp : Re.re
type parse_extras_f= string -> Dose_common.Format822.stanza -> stringParsing 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 -> Dose_common.Format822.stanza -> (string * string) listval parse_s : ?default:'a -> ?required:bool -> (Dose_common.Format822.field -> 'a) -> string -> Dose_common.Format822.stanza -> 'aparse_s is a generic function used to extract and parse a field from a stanza and cast it to a value.
?defaultassign a default value if the field is absent. The function raiseParseErrorif?requiredis true ( default false ) and the field is absent and no default is given.parse_sgets a parsing function, a label and a stanza and returns the value associated to the label.
val get_field_value : parse:(string -> Dose_common.Format822.stanza -> 'a) -> par:Dose_common.Format822.stanza -> field:(string * 'a option) -> string * 'aget_field_value is a generic function used to extract and parse values from a Format822.stanza. It gets a parsing function
parse, a stanzaparand a tuplefieldwhere 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 apackageobject with certains defaults values without parsing the entire stanza.
Generic Parsing Functions
class package : ?name:(string * Dose_pef.Packages_types.name option) -> ?version:(string * Dose_pef.Packages_types.version option) -> ?installed:(string * Dose_pef.Packages_types.installed option) -> ?depends:(string * Dose_pef.Packages_types.vpkgformula option) -> ?conflicts:(string * Dose_pef.Packages_types.vpkglist option) -> ?provides:(string * Dose_pef.Packages_types.vpkglist option) -> ?recommends:(string * Dose_pef.Packages_types.vpkgformula option) -> ?extras:((string * parse_extras_f option) list * (string * string) list option) -> Dose_common.Format822.stanza -> object ... endRepresentation of a PEF package. This object gets a stanza (a list of list of fields) and return a pef object. Each field can be directly initialized using the optional arguments, providing the name of the field and an optional value. If the value is None, then the value is computed by parsing the corresponding field in the 822 stanza. Otherwise, the field is initialized using the given value (and ignoring the value in the 822 stanza).
val parse_package_stanza : filter:(Dose_common.Format822.stanza -> bool) option -> extras:(string * (string -> Dose_common.Format822.stanza -> string) option) list -> Dose_common.Format822.stanza -> package optionval input_raw : ?extras:(string * (string -> Dose_common.Format822.stanza -> string) option) list -> string list -> package listRead 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:(Dose_common.Format822.stanza -> bool) -> ?extras:(string * (string -> Dose_common.Format822.stanza -> string) option) list -> string -> IO.input -> package listsame as
parse_package_stanzabut read packages stanzas from the given IO channel
val input_raw_in : ?extras:(string * (string -> Dose_common.Format822.stanza -> string) option) list -> IO.input -> package listinput_raw_inbehaves asinput_rawbut read the packages stanzas from the given IO channel
Low Level Parsing Functions
val packages_parser : string -> (Dose_common.Format822.stanza -> 'package option) -> Dose_common.Format822.f822_parser -> 'package list