Page
Library
Module
Module type
Parameter
Class
Class type
Source
Cudf
SourceCUDF 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
*)}
a CUDF document with its information items
a single information item
violation of a constraint imposed by CUDF specification
package universe (including package status, i.e., installed packages)
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
add a package to an existing universe. The universe is modified in place.
remove a package from an existing universe. The universe is modified in place
Lookup a specific package via a <name, version> key
Check 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 ->
bool
check 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) list
Ask who provides a given feature (predicate).
val lookup_packages :
?filter:Cudf_types.constr ->
universe ->
Cudf_types.pkgname ->
package list
lookup all available versions of a given package name
lookup 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
iter over all packages in the universe
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
iter 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 ->
'a
fold on all packages grouped by name. Each package name is associated to a list of packages with the same name and different versions
return the list of all unique package names
conversion from universe to plain package list
total numer of available packages (no matter whether they are installed or not)
total number of installed packages occurring in the universe
Projection on packages having "installed: true".
Inefficient (involves Hashtbl.t cloning), use with care.
low-level property lookup: given a package, lookup on it a property by name, returning its (pretty-printed, see Cudf_types
) value as a string
Same 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"
Same 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"
Same as Cudf.lookup_package_property
, but return a typed value.
Same as Cudf.lookup_request_property
, but return a typed value.
Same as Cudf.lookup_preamble_property
, but return a typed value.
lookup 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
.
Check whether a version matches a version constraint, e.g. version_matches 1 (Some(`Eq, 2)) = false
Same as Cudf.version_matches