package dose3

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Dose_common.CudfAddSource

Library of additional functions for the CUDF format.

Basic comparison operations for packages

Sourceval equal : Cudf.package -> Cudf.package -> bool

Equality test: two CUDF packages are equal if their names and versions are equal.

Sourceval compare : Cudf.package -> Cudf.package -> int

Compare function: compares two CUDF packages using standard CUDF comparison operator (i.e. comparing by their name and version).

Specialized data structures for CUDF packages

Sourceval hash : Cudf.package -> int

A hash function for CUDF packages, using only their name and version.

Sourceval sort : ?asc:bool -> Cudf.package list -> Cudf.package list

Sort function: sorts a CUDF packages list using the standard CUDF comparison operator in ascending order.

Data structures

Specialized hashtable for CUDF packages.

Sourcemodule Cudf_set : Set.S with type elt = Cudf.package

Specialized set data structure for CUDF packages.

Sourceval to_set : Cudf_set.elt list -> Cudf_set.t

Convert a list of CUDF packages to a set of CUDF packages.

Extended function on Cudf data types

Sourceval who_provides : Cudf.universe -> Cudf_types.vpkg -> Cudf.package list

Return the list of packages that that respect the given constraint

Return the list of packages satisfying the vpkg list

Sourceval who_depends : Cudf.universe -> Cudf.package -> Cudf.package list list

Returns the list of packages that are dependencies of the given package

Sourcetype ctable = (int, int list ref) ExtLib.Hashtbl.t

A table to associate to each id the list of packages id that are in conflict with it. Reflexive conflicts are made explicit.

Sourceval init_conflicts : Cudf.universe -> ctable

Create a ctable from a package universe

Sourceval who_conflicts : ctable -> Cudf.universe -> Cudf.package -> Cudf.package list

Return the list of packages in conflict with the given package

Sourceval resolve_vpkg_int : Cudf.universe -> Cudf_types.vpkg -> int list

Like who_provides but returns a list of cudf ids

Sourceval resolve_vpkgs_int : Cudf.universe -> Cudf_types.vpkglist -> int list

Like resolve_deps but returns a list of cudf ids

Functions to encode and decode strings.

Sourceval encode : string -> string

Encode 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"
Sourceval decode : string -> string

Decode a string. Opposite of the encode function.

Replaces all the encoded "not allowed" characters in the string by their original (i.e. not encoded) versions.

Examples:

  • decode "ab" = "ab"
  • decode "%7c" = "|"
  • decode "a%7cb" = "a|b"

Additional functions on the CUDF data types.

Sourceval latest : ?n:int -> Cudf.package list -> Cudf.package list

Returns a list of packages containing for each package n most recent version (default the latest version)

Set of strings

Returns the set of all names in the given universe

Add a new property to the given cudf preamble

Sourceval get_property : string -> Cudf.package -> string

return the value of the requested property. * emit a warning and raise Not_found if the property does not exist

Sourceval is_essential : Cudf.package -> bool

Returns true if the package is essential, that is the cudf package has a extra property named "essential" and its value is "yes"

Sourceval realversionmap : Cudf.package list -> (Cudf_types.pkgname * string, Cudf.package) ExtLib.Hashtbl.t

build a hash table that associates (package name, String version) to CUDF packages

Sourceval pkgtoint : Cudf.universe -> Cudf.package -> int

Return the unique cudf id of a package in a universe

Sourceval inttopkg : Cudf.universe -> int -> Cudf.package

Given a universe and a cudf id returns the corresponding package. Raise Not_found if the id does not correspond to a package.

Sourceval compute_pool : Cudf.universe -> int list list array * int list array
Sourceval add_to_package_list : ('a, 'b list ref) ExtLib.Hashtbl.t -> 'a -> 'b -> unit
Sourceval get_package_list : ('a, 'b list ref) ExtLib.Hashtbl.t -> 'a -> 'b list
Sourceval normalize_set : int list -> int list

normalize_set l returns the list l without any duplicate element.

Sourceval is_nan_version : int -> bool

Check if a CUDF version is nan

Sourceval nan_version : int

Version constant for impossible constraint

Formatting, printing, converting to string.

Sourceval string_of : (Format.formatter -> 'a -> 'b) -> 'a -> string
Sourceval pp_version : Format.formatter -> Cudf.package -> unit
Sourceval pp_package : Format.formatter -> Cudf.package -> unit
Sourceval string_of_version : Cudf.package -> string

return a string containg either the value of the optional field "number" or the cudf version

Sourceval string_of_package : Cudf.package -> string

return a string of the form "name ( = version)"

Sourcetype pp = Cudf.package -> string * string option * string * (string * (string * bool)) list
Sourceval pp : ((Cudf_types.pkgname * Cudf_types.version) -> string * string option * string) -> ?fields:string list -> ?decode:(Cudf_types.pkgname -> string) -> pp

pp ?decode from_cudf pkg package pretty printer. from_cudf a function that gets a (name,cudfversion) pair and returns a (name,realversion). ?fields additional fields to print. ?decode a 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"

Sourceval default_pp : pp

default_pp default 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".

Sourceval pp_vpkg : pp -> Format.formatter -> Cudf_types.vpkg -> unit

cudf vpkglist printer.

Sourceval pp_vpkglist : pp -> Format.formatter -> Cudf_types.vpkglist -> unit

cudf vpkglist printer.

Sourceval cone : Cudf.universe -> Cudf.package list -> Cudf.package list

Compute the depenency cone of a list of packages

OCaml

Innovation. Community. Security.