15 /* ----------------------------------------------
18 * providerN(B) == Package Id of package providing tag B
19 * N = 1, 2, 3, in case of multiple providers
21 * A requires B : !A | provider1(B) | provider2(B)
23 * A conflicts B : (!A | !provider1(B)) & (!A | !provider2(B)) ...
25 * 'not' is encoded as a negative Id
27 * Binary rule: p = first literal, d = 0, w2 = second literal, w1 = p
31 Id p; /* first literal in rule */
32 Id d; /* Id offset into 'list of providers terminated by 0' as used by whatprovides; pool->whatprovides + d */
33 /* in case of binary rules, d == 0, w1 == p, w2 == other literal */
34 Id w1, w2; /* watches, literals not-yet-decided */
35 /* if !w1, disabled */
36 /* if !w2, assertion, not rule */
37 Id n1, n2; /* next rules in linked list, corresponding to w1,w2 */
40 typedef struct solver {
44 int fixsystem; /* repair errors in rpm dependency graph */
45 int allowdowngrade; /* allow to downgrade installed solvable */
46 int allowarchchange; /* allow to change architecture of installed solvables */
47 int allowuninstall; /* allow removal of system solvables, else keep all installed solvables */
48 int updatesystem; /* distupgrade */
49 int allowvirtualconflicts; /* false: conflicts on package name, true: conflicts on package provides */
50 int noupdateprovide; /* true: update packages needs not to provide old package */
52 Rule *rules; /* all rules */
53 Id nrules; /* rpm rules */
55 Id jobrules; /* user rules */
56 Id systemrules; /* policy rules, e.g. keep packages installed or update. All literals > 0 */
57 Id weakrules; /* rules that can be autodisabled */
58 Id learntrules; /* learnt rules */
60 Id *weaksystemrules; /* please try to install (r->d) */
62 Id *watches; /* Array of rule offsets
63 * watches has nsolvables*2 entries and is addressed from the middle
64 * middle-solvable : decision to conflict, offset point to linked-list of rules
65 * middle+solvable : decision to install: offset point to linked-list of rules
70 Queue decisionq_why; /* index of rule, Offset into rules */
71 Id *decisionmap; /* map for all available solvables, > 0: level of decision when installed, < 0 level of decision when conflict */
73 /* learnt rule history */
80 Queue suggestions; /* suggested packages */
82 Map recommendsmap; /* recommended packages from decisionmap */
83 Map suggestsmap; /* suggested packages from decisionmap */
84 int recommends_index; /* recommended level */
86 Id *obsoletes; /* obsoletes for each system solvable */
87 Id *obsoletes_data; /* data area for obsoletes */
89 int rc_output; /* output result compatible to redcarpet/zypp testsuite, set == 2 for pure rc (will suppress architecture) */
98 SOLVER_INSTALL_SOLVABLE,
99 SOLVER_ERASE_SOLVABLE,
100 SOLVER_INSTALL_SOLVABLE_NAME,
101 SOLVER_ERASE_SOLVABLE_NAME,
102 SOLVER_INSTALL_SOLVABLE_PROVIDES,
103 SOLVER_ERASE_SOLVABLE_PROVIDES,
104 SOLVER_INSTALL_SOLVABLE_UPDATE
107 extern Solver *solver_create(Pool *pool, Source *system);
108 extern void solver_free(Solver *solv);
109 extern void solve(Solver *solv, Queue *job);
111 extern void prune_best_version_arch(Pool *pool, Queue *plist);
113 void printdecisions(Solver *solv);
116 #endif /* SOLVER_H */