CudfCUDF library
type package = {package : Cudf_types.pkgname;version : Cudf_types.version;depends : Cudf_types.vpkgformula;conflicts : Cudf_types.vpkglist;provides : Cudf_types.veqpkglist;installed : bool;was_installed : bool;keep : Cudf_types.enum_keep;pkg_extra : Cudf_types.typed_value Cudf_types.stanza;}Representation of a parsed package description item.
With this representation, optional properties have already been expanded to their default values (if they have one). It is not possible to know whether they were present or not in the CUDF syntax.
package equality up to <name, version> i.e. 2 packages are equal iff they have the same name and version
Package comparison up to <name, version>. Same rules of package equality, but providing a suitable replacement for Pervasives.compare; useful for sorting.
type request = {request_id : string;install : Cudf_types.vpkglist;remove : Cudf_types.vpkglist;upgrade : Cudf_types.vpkglist;req_extra : Cudf_types.typed_value Cudf_types.stanza;}type preamble = {preamble_id : string;text following the "preamble: " postmark
*)property : Cudf_types.typedecl;extra property declarations
*)univ_checksum : string;universe checksum
*)status_checksum : string;status checksum
*)req_checksum : string;request checksum
*)}val default_preamble : preambleimplement preamble defaults
val default_package : packageimplement package defaults
val default_request : requestimplement request defaults
a single information item
CUDF-based encoding of solutions, see CUDF 2.0, appendix B
A universe encoding a solution matters only for its installed packages, which are considered to be the resulting package status
val empty_universe : ?size:int -> unit -> universereturn an empty universe.
add a package to an existing universe. The universe is modified in place.
val remove_package :
universe ->
(Cudf_types.pkgname * Cudf_types.version) ->
unitremove a package from an existing universe. The universe is modified in place
val lookup_package :
universe ->
(Cudf_types.pkgname * Cudf_types.version) ->
packageLookup a specific package via a <name, version> key
val mem_package : universe -> (Cudf_types.pkgname * Cudf_types.version) -> boolCheck existence of a specific package in the universe via a <name, version> key
val mem_installed :
?include_features:bool ->
?ignore:(package -> bool) ->
universe ->
Cudf_types.vpkg ->
boolcheck wheather a given package constraint is satisfied in a given package status (i.e., the universe subset of installed packages)
val who_provides :
?installed:bool ->
universe ->
Cudf_types.vpkg ->
(package * Cudf_types.version option) listAsk who provides a given feature (predicate).
val lookup_packages :
?filter:Cudf_types.constr ->
universe ->
Cudf_types.pkgname ->
package listlookup all available versions of a given package name
val get_installed : universe -> Cudf_types.pkgname -> package listlookup all installed versions of a given package name. Shorthand for lookup_packages composed with filtering on installed=true
return a unique integer identifier for the given package in the universe
return the package corresponding to the given unique identifier
fold over all packages in the universe
iter on all packages in the universe, passing to the iteration function both the package and its unique identifier
val iter_packages_by_name :
(Cudf_types.pkgname -> package list -> unit) ->
universe ->
unititer on all packages grouped by name. Each package name is associated to a list of packages with the same name and different versions
val fold_packages_by_name :
('a -> Cudf_types.pkgname -> package list -> 'a) ->
'a ->
universe ->
'afold on all packages grouped by name. Each package name is associated to a list of packages with the same name and different versions
val package_names : universe -> Cudf_types.pkgname listreturn the list of all unique package names
conversion from universe to plain package list
val universe_size : universe -> inttotal numer of available packages (no matter whether they are installed or not)
val installed_size : universe -> inttotal number of installed packages occurring in the universe
Projection on packages having "installed: true".
Inefficient (involves Hashtbl.t cloning), use with care.
val lookup_package_property : package -> string -> stringlow-level property lookup: given a package, lookup on it a property by name, returning its (pretty-printed, see Cudf_types) value as a string
val lookup_request_property : request -> string -> stringSame as Cudf.lookup_package_property, but acting on request information items.
To lookup the request identifier as a string (which strictly speaking is not a property) you should lookup "request"
val lookup_preamble_property : preamble -> string -> stringSame as Cudf.lookup_package_property, but acting on preamble information items.
To lookup the preamble identifier as a string (which strictly speaking is not a property) you should lookup "preamble"
val lookup_typed_package_property : package -> string -> Cudf_types.typed_valueSame as Cudf.lookup_package_property, but return a typed value.
val lookup_typed_request_property : request -> string -> Cudf_types.typed_valueSame as Cudf.lookup_request_property, but return a typed value.
val lookup_typed_preamble_property :
preamble ->
string ->
Cudf_types.typed_valueSame as Cudf.lookup_preamble_property, but return a typed value.
val lookup_package_typedecl :
?extra:Cudf_types.typedecl ->
string ->
Cudf_types.typedecl1lookup the type declaration of a given property (either core or extra)
Note: lookup_typedecl name is not the same as List.assoc preamble.property name; only the former takes into account core package properties. See also Cudf_conf.package_typedecl.
val version_matches : Cudf_types.version -> Cudf_types.constr -> boolCheck whether a version matches a version constraint, e.g. version_matches 1 (Some(`Eq, 2)) = false
val (|=) : Cudf_types.version -> Cudf_types.constr -> boolSame as Cudf.version_matches