Module Common
module Util : sig
val uuid : unit -> string
val list_unique : 'a list -> 'a list
return a list of unique elements. This algorithm runs in
O(n) but is not stable . elements are returned in reverse order
val memo : 'a -> 'b -> 'a -> 'b
A generic memoization function. To use with care as it allocates
an hashtbl storing all results that will be released only on exit
val timestamp : unit -> string
type label = string
module type Messages = sig
type t
create a new message handle with label
t
.
Printing is disabled per default
val create : ?enabled:bool -> label -> t
val eprintf : ?raw:bool -> t -> ('a, unit, string, unit) Pervasives.format4 -> 'a
Print the message on
stderr
if the Util module has been
set to verbose using the function make_verbose
and
either the handle t
is enable or all handles were enabled with
the function all_enabled
val enable : label -> unit
enable l
the handle with label l
val disable : label -> unit
disable l
the handle with label l
val all_disabled : unit -> unit
disable all handles in the module
val all_enabled : unit -> unit
enable all handles in the module
val avalaible : unit -> label list
return the list of all labels known to the module
val is_enabled : label -> bool
end
module Debug : Messages
Debug, Info and Warning messages are printed immediately on stderr.
Info messages are enabled per default. Debug and Warning messages
must be enabled explicitely
module Warning : Messages
module Info : Messages
module Notice : Messages
module Progress : sig
ProgressBars are printed immediately on stderr.
To be used, the **must** be created outside the functions where
they are used.
They can enabled or disabled (default)
type t
val create : ?enabled:bool -> ?total:int -> ?unbounded:bool -> label -> t
create "barname"
: create new a progress bar labelled "barname".
The progress bar is disabled by default
val enable : label -> unit
enable "barname"
: enable the progress bar with label "barname"
val disable : label -> unit
disable "barname"
: disable the progress bar with label "barname"
val set_total : t -> int -> unit
set_total bar 10
: set the max width of the progress bar to 10 units
val progress : ?i:int -> t -> unit
increment the progress bar of
i
units
val reset : t -> unit
reset the progress bar
val available : unit -> label list
return the labels of all available progress bar
end
module Timer : sig
Timers are printed all at once by the
dump
function on stderr.
They can enabled or disabled (default)
type t
val create : ?enabled:bool -> string -> t
create s
create and register a new logger named s
val enable : label -> unit
enable "barname"
: enable the progress bar with label "barname"
val start : t -> unit
val stop : t -> 'a -> 'a
val available : unit -> label list
return the labels of all available progress bar
end
module IntHashtbl : sig
type key = int
type 'a t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : key -> 'a -> unit -> 'a t -> unit
val fold : key -> 'a -> 'b -> 'b -> 'a t -> 'b -> 'b
val length : 'a t -> int
end
module IntPairHashtbl : sig
type key = (int * int)
type 'a t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : key -> 'a -> unit -> 'a t -> unit
val fold : key -> 'a -> 'b -> 'b -> 'a t -> 'b -> 'b
val length : 'a t -> int
end
module StringHashtbl : sig
type key = string
type 'a t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : key -> 'a -> unit -> 'a t -> unit
val fold : key -> 'a -> 'b -> 'b -> 'a t -> 'b -> 'b
val length : 'a t -> int
end
module StringPairHashtbl : sig
type key = (string * string)
type 'a t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : key -> 'a -> unit -> 'a t -> unit
val fold : key -> 'a -> 'b -> 'b -> 'a t -> 'b -> 'b
val length : 'a t -> int
end
val range : int -> int -> int list
val string_of_list : 'a -> string -> string -> 'a list -> string
end
module EdosSolver : sig
module type S = sig
generic failure reason
type reason
end
module type T = sig
Sat solver functor type
module X : S
generic failure reason
type state
state of the solver
type var = int
variables are integers numbered from 0 to (size - 1)
type value =
| True
| False
| Unknown
The value of a literal
type lit
A literal. Literals can be positive or negative
val lit_of_var : var -> bool -> lit
lit_of_var
given a variable create a positive or a negative literal.
By default the assigment of all variables (that is its value) is
Unknown.
val initialize_problem : ?pbo:int array -> ?print_var:Format.formatter -> int -> unit -> ?buffer:bool -> int -> state
initialize the solver
initialize_problem n
print_var a function to print a variable
buffer decide weather or not to store a human readable
representaion of the sat problem.
n the size of the sat problem. that is the max number of
variables to consider
val copy : state -> state
provide a deep copy of the current state of the solver
val propagate : state -> unit
val protect : state -> unit
val reset : state -> unit
reset
reset the state of the solver to a state that would be obtained
by re initializing the solver with an identical constraints set
val assignment : state -> value array
assignment st
return the array of values associated to every variable.
val assignment_true : state -> var list
assignment_true st
return the list of variables that are true
val add_rule : state -> lit array -> X.reason list -> unit
add_rule st l
add a disjuction to the solver of type TARGET NONE: \Bigvee l
val associate_vars : state -> lit -> var list -> unit
associate_vars st lit vl
associate a variable to a list of variables. The solver
will use this information to guide the search heuristic
val solve_all : state -> unit -> state -> var -> bool
val solve_pbo : (int array * state) -> unit -> state -> var -> bool
solve st v
finds a variable assignment that makes v
True
val solve : state -> var -> bool
val solve_lst : state -> var list -> bool
solve st l
finds a variable assignment that makes True
all variables in l
val collect_reasons : state -> var -> X.reason list
in case of failure return the list of associated reasons
val collect_reasons_lst : state -> var list -> X.reason list
in case of failure return the list of associated reasons
val dump : state -> (int * bool) list list
if the solver was initialized with
buffer = true
,
dump the state of the solver. Return an empty list otherwise
val debug : bool -> unit
enable debug messages
val stats : state -> unit
val pboidx : state -> int -> int -> int
end
end
module CudfSolver : sig
module Pcre = Re_pcre
val it : Util.Info.t
val nt : Util.Notice.t
val wt : Util.Warning.t
val dt : Util.Debug.t
val check_fail : string -> bool
val mktmpdir : string -> string
val rmtmpdir : string -> unit
val quote : string -> string
val sanitize : string -> string
val interpolate_solver_pat : string -> string -> string -> string -> string
exception Error of string
exception Unsat
val timer3 : Util.Timer.t
val timer4 : Util.Timer.t
end
module Url : sig
type debtypes = TODO: a
type rpmtypes = TODO: a
type osgitypes = TODO: a
type othertypes = TODO: a
type filetypes = TODO: a
val supported_input_types : filetypes list
type url = {
scheme : filetypes;
path : string; (* db name or filename *)
}
val of_string : string -> url
exception Invalid_url of string
val to_string : url -> string
val scheme_to_string : filetypes -> string
val scheme_of_string : string -> filetypes
end
module Input : sig
val parse_uri : string -> (Url.filetypes * (string option * string option * string option * string option * string) * string option)
parse a uri.
i.e. :
deb://path/to/file
rpm://path/to/file
cudf://path/to/file
Returns a tuple representing the uri
val guess_format : string list list -> Url.filetypes
guess the input format from a list of list of uris and check
if the list is omogenueous w.r.t the guessed format. Fails otherwise
end
module CudfAdd : sig
module Cudf_hashtbl : sig
Specialized hashtable for CUDF packages.
type 'a t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : key -> 'a -> unit -> 'a t -> unit
val fold : key -> 'a -> 'b -> 'b -> 'a t -> 'b -> 'b
val length : 'a t -> int
end
module Cudf_set : sig
Specialized set data structure for CUDF packages.
type t
val empty : t
val is_empty : t -> bool
val mem : elt -> t -> bool
val add : elt -> t -> t
val singleton : elt -> t
val remove : elt -> t -> t
val union : t -> t -> t
val inter : t -> t -> t
val diff : t -> t -> t
val compare : t -> t -> int
val equal : t -> t -> bool
val subset : t -> t -> bool
val iter : elt -> unit -> t -> unit
val fold : elt -> 'a -> 'a -> t -> 'a -> 'a
val for_all : elt -> bool -> t -> bool
val exists : elt -> bool -> t -> bool
val filter : elt -> bool -> t -> t
val partition : elt -> bool -> t -> (t * t)
val cardinal : t -> int
val elements : t -> elt list
val min_elt : t -> elt
val max_elt : t -> elt
val choose : t -> elt
val split : elt -> t -> (t * bool * t)
val find : elt -> t -> elt
val of_list : elt list -> t
end
val to_set : Cudf_set.elt list -> Cudf_set.t
Convert a list of CUDF packages to a set of CUDF packages.
type ctable = (int, int list Pervasives.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.
val resolve_vpkg_int : Cudf.universe -> Cudf_types.vpkg -> int list
Like who_provides but returns a list of cudf ids
val resolve_vpkgs_int : Cudf.universe -> Cudf_types.vpkglist -> int list
Like resolve_deps but returns a list of cudf ids
val 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:
Examples:
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"
val decode : string -> string
Decode a string. Opposite of the
Replaces all the encoded "not allowed" characters in the string by their original (i.e. not encoded) versions.
Examples:
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"
module StringSet : sig
Set of strings
type t
val empty : t
val is_empty : t -> bool
val mem : elt -> t -> bool
val add : elt -> t -> t
val singleton : elt -> t
val remove : elt -> t -> t
val union : t -> t -> t
val inter : t -> t -> t
val diff : t -> t -> t
val compare : t -> t -> int
val equal : t -> t -> bool
val subset : t -> t -> bool
val iter : elt -> unit -> t -> unit
val fold : elt -> 'a -> 'a -> t -> 'a -> 'a
val for_all : elt -> bool -> t -> bool
val exists : elt -> bool -> t -> bool
val filter : elt -> bool -> t -> t
val partition : elt -> bool -> t -> (t * t)
val cardinal : t -> int
val elements : t -> elt list
val min_elt : t -> elt
val max_elt : t -> elt
val choose : t -> elt
val split : elt -> t -> (t * bool * t)
val find : elt -> t -> elt
val of_list : elt list -> t
end
val cudfop : (string * string) option -> (TODO: a * string) option
val pp : (Cudf_types.pkgname * Cudf_types.version) -> ('a * Cudf_types.pkgname) -> ?decode:Cudf_types.pkgname -> string -> Cudf.package -> (string * string * (string * string) list)
returns : a pair (name,versiom,property list)
note that if the package has version less then 0, then the version is printed as "nan"
pp ?decode from_cudf pkg
package pretty printer.
from_cudf
a function that gets a (name,cudfversion) pair and returns a
(name,realversion).
?decode
a function that decode the package name and versionreturns : a pair (name,versiom,property list)
note that if the package has version less then 0, then the version is printed as "nan"
val normalize_set : int list -> int list
normalize_set l returns the list l without any duplicate element.
end
module CudfDiff : sig
module Cudf_set = CudfAdd.Cudf_set
module StringSet = CudfAdd.StringSet
type solution = {
installed : Cudf_set.t;
removed : Cudf_set.t;
}
type summary_t = {}
all
: all versions of a package in the universe .
s
: the set of version for version of a package in a solution
returns a list that contains for each version its status : installed,
removed, upgraded, etc
val default_summary : unit -> summary_t
val uniqueversion : Cudf_set.t -> solution -> summary_t
end
module VersionInfo : sig
val svn_rev : string
val svn_lastchangedate : string
val ocaml_version : string
val build_timestamp : string
val build_host : string
val build_os : string
val version : string
end