Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 107 lines (82 sloc) 3.812 kb
2ea5d1d @samoht Solver clean-ups
samoht authored
1 (***********************************************************************)
2 (* *)
3 (* Copyright 2012 OCamlPro *)
4 (* Copyright 2012 INRIA *)
5 (* *)
6 (* All rights reserved. This file is distributed under the terms of *)
7 (* the GNU Public License version 3.0. *)
8 (* *)
9 (* TypeRex is distributed in the hope that it will be useful, *)
10 (* but WITHOUT ANY WARRANTY; without even the implied warranty of *)
11 (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *)
12 (* GNU General Public License for more details. *)
13 (* *)
14 (***********************************************************************)
15
e04535c @samoht Add API documentation
samoht authored
16 (** SAT-solver for package dependencies and conflicts. *)
2ea5d1d @samoht Solver clean-ups
samoht authored
17
e04535c @samoht Add API documentation
samoht authored
18 open Types
2ea5d1d @samoht Solver clean-ups
samoht authored
19
20 (** {2 Package actions} *)
21
22 (** Build action *)
23 type action =
24
25 (** The package must be installed. The package could have been
26 present or not, but if present, it is another version than the
27 proposed solution. *)
28 | To_change of NV.t option * NV.t
29
30 (** The package must be deleted. *)
31 | To_delete of NV.t
32
33 (** The package is already installed, but it must be recompiled. *)
34 | To_recompile of NV.t
35
36 (** Package with associated build action *)
37 type package_action
38
39 (** Return the corresponding build action *)
40 val action: package_action -> action
41
42 (** Package action graph *)
43 module PA_graph : sig
44 include Graph.Sig.I with type V.t = package_action
45 module Parallel: Parallel.SIG
46 with type G.t = t
47 and type G.V.t = V.t
48 end
49
50 (** {2 Solver} *)
51
52 (** Solver request *)
53 type request = {
d636f87 @tuong [solving system] we can now try several heuristics when calling [solver....
tuong authored
54 wish_install: and_formula;
55 wish_remove : and_formula;
56 wish_upgrade: and_formula;
2ea5d1d @samoht Solver clean-ups
samoht authored
57 }
58
469889d @samoht [init] installing a default package at startup containing global variabl...
samoht authored
59 (** Convert a request to a string *)
60 val string_of_request: request -> string
61
2ea5d1d @samoht Solver clean-ups
samoht authored
62 (** Solver solution *)
63 type solution = {
64 to_remove: NV.t list;
65 to_add : PA_graph.t;
66 }
67
469889d @samoht [init] installing a default package at startup containing global variabl...
samoht authored
68 (** Does the solution implies deleting or updating a package *)
69 val delete_or_update : solution -> bool
70
2ea5d1d @samoht Solver clean-ups
samoht authored
71 (** Display a solution *)
72 val print_solution: solution -> unit
73
469889d @samoht [init] installing a default package at startup containing global variabl...
samoht authored
74 (** Package *)
75 type package = Debian.Packages.package
2ea5d1d @samoht Solver clean-ups
samoht authored
76
469889d @samoht [init] installing a default package at startup containing global variabl...
samoht authored
77 (** Universe of packages *)
78 type universe = U of package list
2ea5d1d @samoht Solver clean-ups
samoht authored
79
469889d @samoht [init] installing a default package at startup containing global variabl...
samoht authored
80 (** Subset of packages *)
81 type packages = P of package list
2ea5d1d @samoht Solver clean-ups
samoht authored
82
469889d @samoht [init] installing a default package at startup containing global variabl...
samoht authored
83 (** Given a description of packages, return a solution preserving the
e6cb62d @tuong [solver] we modify the return type from [option] to [list].
tuong authored
84 consistency of the initial description. An empty [list] : No solution
85 found. The last argument is the set of packages to reinstall.
86
87 Every element in the solution [list] satisfies the problem given.
88 For the ordering, the first element in the list
89 is obtained by upgrading from its next element. *)
90 val resolve : universe -> request -> NV.Set.t -> solution list
2ea5d1d @samoht Solver clean-ups
samoht authored
91
469889d @samoht [init] installing a default package at startup containing global variabl...
samoht authored
92 (** Return the recursive dependencies of a package Note : the given
93 package exists in the list in input because this list describes
8dbd512 @tuong [opam remove] optional dependencies are included in the dependency graph
tuong authored
94 the entire universe. By convention, it also appears in output.
95 If [depopts] (= [false] by default) is set to [true],
96 optional dependencies are merged with usual dependencies. *)
97 val filter_backward_dependencies : ?depopts:bool -> universe -> packages -> package list
2ea5d1d @samoht Solver clean-ups
samoht authored
98
469889d @samoht [init] installing a default package at startup containing global variabl...
samoht authored
99 (** Same as [filter_backward_dependencies] but for forward
100 dependencies *)
8dbd512 @tuong [opam remove] optional dependencies are included in the dependency graph
tuong authored
101 val filter_forward_dependencies : ?depopts:bool -> universe -> packages -> package list
374d808 @tuong fix the order of packages that are proposed by "opam remove"
tuong authored
102
103 (** Return a permutation of the given set of packages :
104 if package B depends of package A then
105 B appears before A in the resulting list *)
8dbd512 @tuong [opam remove] optional dependencies are included in the dependency graph
tuong authored
106 val sort_by_backward_dependencies : ?depopts:bool -> universe -> packages -> package list
Something went wrong with that request. Please try again.