Module Dose_common__CudfAdd
Library of additional functions for the CUDF format.
Basic comparison operations for packages
Specialized data structures for CUDF packages
Data structures
module Cudf_hashtbl : Stdlib.Hashtbl.S with type Cudf_hashtbl.key = Cudf.packageSpecialized hashtable for CUDF packages.
module Cudf_set : Stdlib.Set.S with type Cudf_set.elt = Cudf.packageSpecialized set data structure for CUDF packages.
Extended function on Cudf data types
val who_provides : Cudf.universe -> Cudf_types.vpkg -> Cudf.package listReturn the list of packages that that respect the given constraint
val resolve_deps : Cudf.universe -> Cudf_types.vpkglist -> Cudf.package listReturn the list of packages satisfying the vpkg list
val who_depends : Cudf.universe -> Cudf.package -> Cudf.package list listReturns the list of packages that are dependencies of the given package
type ctable= (int, int list Stdlib.ref) ExtLib.Hashtbl.tA table to associate to each id the list of packages id that are in conflict with it. Reflexive conflicts are made explicit.
val init_conflicts : Cudf.universe -> ctableCreate a ctable from a package universe
val who_conflicts : ctable -> Cudf.universe -> Cudf.package -> Cudf.package listReturn the list of packages in conflict with the given package
Functions to encode and decode strings.
val encode : string -> stringEncode a string.
Replaces all the "not allowed" characters with their ASCII code (in hexadecimal format), prefixed with a '%' sign.
Only "allowed" characters are letters, numbers and these:
@/+().-, all the others are replaced.Examples:
encode "ab" = "ab"encode "|" = "%7c"encode "a|b" = "a%7cb"
Additional functions on the CUDF data types.
val latest : ?n:int -> Cudf.package list -> Cudf.package listReturns a list of packages containing for each package
nmost recent version (default the latest version)
module StringSet : Stdlib.Set.S with type StringSet.elt = ExtLib.String.tSet of strings
val pkgnames : Cudf.universe -> StringSet.tReturns the set of all names in the given universe
val add_properties : Cudf.preamble -> Cudf_types.typedecl -> Cudf.preambleAdd a new property to the given cudf preamble
val get_property : string -> Cudf.package -> stringreturn the value of the requested property. * emit a warning and raise Not_found if the property does not exist
val is_essential : Cudf.package -> boolReturns true if the package is essential, that is the cudf package has a extra property named "essential" and its value is "yes"
val realversionmap : Cudf.package list -> (Cudf_types.pkgname * string, Cudf.package) ExtLib.Hashtbl.tbuild a hash table that associates (package name, String version) to CUDF packages
val pkgtoint : Cudf.universe -> Cudf.package -> intReturn the unique cudf id of a package in a universe
val inttopkg : Cudf.universe -> int -> Cudf.packageGiven a universe and a cudf id returns the corresponding package. Raise Not_found if the id does not correspond to a package.
val compute_pool : Cudf.universe -> int list list array * int list arrayval add_to_package_list : ('a, 'b list Stdlib.ref) ExtLib.Hashtbl.t -> 'a -> 'b -> unitval get_package_list : ('a, 'b list Stdlib.ref) ExtLib.Hashtbl.t -> 'a -> 'b listval normalize_set : int list -> int listnormalize_set l returns the list l without any duplicate element.
Formatting, printing, converting to string.
val string_of : (Stdlib.Format.formatter -> 'a -> 'b) -> 'a -> stringval pp_version : Stdlib.Format.formatter -> Cudf.package -> unitval pp_package : Stdlib.Format.formatter -> Cudf.package -> unitval string_of_version : Cudf.package -> stringreturn a string containg either the value of the optional field "number" or the cudf version
val pp : ((Cudf_types.pkgname * Cudf_types.version) -> string * string option * string) -> ?fields:string list -> ?decode:(Cudf_types.pkgname -> string) -> pppp ?decode from_cudf pkgpackage pretty printer.from_cudfa function that gets a (name,cudfversion) pair and returns a (name,realversion).?fieldsadditional fields to print.?decodea function that decode the package name and version.returns : a pair (name,versiom,property list)
note that if the package has version less then 0, then the version is printed as "nan"
val default_pp : ppdefault_ppdefault package printer. Extracts string values from a cudf package : Name, Version, Fields. Where Fields is a list of field name , value pairs . If the version of the package is a negative number, the version version if printed as "nan".
val pp_vpkg : pp -> Stdlib.Format.formatter -> Cudf_types.vpkg -> unitcudf vpkglist printer.
val pp_vpkglist : pp -> Stdlib.Format.formatter -> Cudf_types.vpkglist -> unitcudf vpkglist printer.