summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2011-05-25 15:28:34 +0200
committerMichael Schroeder <mls@suse.de>2011-05-25 15:28:34 +0200
commit66e7a252604ae81a027a2c7b8c437b7228eddcc4 (patch)
treea44aafbdb3a2cba25f6581f409b779a7354b93cf /src
parent55f5371d10bc44570b2d50bb737aba8a3ae1e93f (diff)
downloadlibsolv-66e7a252604ae81a027a2c7b8c437b7228eddcc4.tar.gz
libsolv-66e7a252604ae81a027a2c7b8c437b7228eddcc4.tar.bz2
libsolv-66e7a252604ae81a027a2c7b8c437b7228eddcc4.zip
- add solver_private.h, make repo_ functions return an int, make solver_solv return the problem count
Diffstat (limited to 'src')
-rw-r--r--src/libsolv.ver2
-rw-r--r--src/policy.c7
-rw-r--r--src/policy.h45
-rw-r--r--src/pool.h2
-rw-r--r--src/problems.c1
-rw-r--r--src/repo.h16
-rw-r--r--src/rules.c1
-rw-r--r--src/solver.c16
-rw-r--r--src/solver.h96
-rw-r--r--src/solver_private.h251
-rw-r--r--src/solverdebug.c1
11 files changed, 293 insertions, 145 deletions
diff --git a/src/libsolv.ver b/src/libsolv.ver
index a992a6b..8e17b42 100644
--- a/src/libsolv.ver
+++ b/src/libsolv.ver
@@ -30,7 +30,6 @@ SOLV_1.0 {
map_grow;
map_init;
map_init_clone;
- policy_create_obsolete_index;
policy_filter_unwanted;
policy_findupdatepackages;
policy_illegal2str;
@@ -253,6 +252,7 @@ SOLV_1.0 {
solver_calculate_noobsmap;
solver_create;
solver_create_decisions_obsoletesmap;
+ solver_create_state_maps;
solver_dep_installed;
solver_disablechoicerules;
solver_disablepolicyrules;
diff --git a/src/policy.c b/src/policy.c
index 8ca71f4..ab5f55b 100644
--- a/src/policy.c
+++ b/src/policy.c
@@ -16,6 +16,7 @@
#include <string.h>
#include "solver.h"
+#include "solver_private.h"
#include "evr.h"
#include "policy.h"
#include "poolvendor.h"
@@ -259,7 +260,7 @@ prune_to_recommended(Solver *solv, Queue *plist)
plist->count = j;
}
-void
+static void
prune_to_best_arch(const Pool *pool, Queue *plist)
{
Id a, bestscore;
@@ -350,7 +351,7 @@ prune_obsoleted(Pool *pool, Queue *plist)
* sort list of packages (given through plist) by name and evr
* return result through plist
*/
-void
+static void
prune_to_best_version(Pool *pool, Queue *plist)
{
int i, j;
@@ -407,7 +408,7 @@ prune_to_best_version(Pool *pool, Queue *plist)
* (rates arch higher than version, but thats a policy)
*/
-void
+static void
prune_best_arch_name_version(const Solver *solv, Pool *pool, Queue *plist)
{
if (solv && solv->bestSolvableCb)
diff --git a/src/policy.h b/src/policy.h
index b072929..734ffde 100644
--- a/src/policy.h
+++ b/src/policy.h
@@ -16,46 +16,6 @@
#define POLICY_MODE_RECOMMEND 1
#define POLICY_MODE_SUGGEST 2
-/* This functions can be used for sorting solvables to a specific order like architecture, version. */
-/* Solvables which does not fit to the system will be deleted from the list. */
-extern void prune_best_arch_name_version(const Solver *solv, Pool *pool, Queue *plist);
-
-extern void prune_to_best_arch(const Pool *pool, Queue *plist);
-extern void prune_to_best_version(Pool *pool, Queue *plist);
-
-
-/* The following default policies can be overloaded by the application by using callbacks which are
- * descibed in solver.h:
- *
- * Finding best candidate
- *
- * Callback definition:
- * void bestSolvable (Pool *pool, Queue *canditates)
- * candidates : List of canditates which has to be sorted by the function call
- * return candidates: Sorted list of the candidates(first is the best).
- *
- * Checking if two solvables has compatible architectures
- *
- * Callback definition:
- * int archCheck (Pool *pool, Solvable *solvable1, Solvable *solvable2);
- *
- * return 0 it the two solvables has compatible architectures
- *
- * Checking if two solvables has compatible vendors
- *
- * Callback definition:
- * int vendorCheck (Pool *pool, Solvable *solvable1, Solvable *solvable2);
- *
- * return 0 it the two solvables has compatible architectures
- *
- * Evaluate update candidate
- *
- * Callback definition:
- * void pdateCandidateCb (Pool *pool, Solvable *solvable, Queue *canditates)
- * solvable : for which updates should be search
- * candidates : List of candidates (This list depends on other
- * restrictions like architecture and vendor policies too)
- */
#define POLICY_ILLEGAL_DOWNGRADE 1
#define POLICY_ILLEGAL_ARCHCHANGE 2
@@ -65,10 +25,7 @@ extern void policy_filter_unwanted(Solver *solv, Queue *plist, int mode);
extern int policy_illegal_archchange(Solver *solv, Solvable *s1, Solvable *s2);
extern int policy_illegal_vendorchange(Solver *solv, Solvable *s1, Solvable *s2);
extern int policy_is_illegal(Solver *solv, Solvable *s1, Solvable *s2, int ignore);
-extern void policy_findupdatepackages(Solver *solv,
- Solvable *s,
- Queue *qs,
- int allowall); /* do not regard policies for vendor,architecuture,... change */
+extern void policy_findupdatepackages(Solver *solv, Solvable *s, Queue *qs, int allowall);
extern void policy_create_obsolete_index(Solver *solv);
diff --git a/src/pool.h b/src/pool.h
index 2b1a93b..8887f43 100644
--- a/src/pool.h
+++ b/src/pool.h
@@ -87,8 +87,8 @@ struct _Pool {
int implicitobsoleteusesprovides; /* true: implicit obsoletes due to same name are matched against provides, not names */
int obsoleteusescolors; /* true: obsoletes check arch color */
int noinstalledobsoletes; /* true: ignore obsoletes of installed packages */
- int novirtualconflicts; /* true: conflicts on names, not on provides */
int allowselfconflicts; /* true: packages which conflict with itself are installable */
+
#ifdef MULTI_SEMANTICS
int disttype;
#endif
diff --git a/src/problems.c b/src/problems.c
index ce75614..6073e01 100644
--- a/src/problems.c
+++ b/src/problems.c
@@ -17,6 +17,7 @@
#include <assert.h>
#include "solver.h"
+#include "solver_private.h"
#include "bitmap.h"
#include "pool.h"
#include "util.h"
diff --git a/src/repo.h b/src/repo.h
index fbec7bf..fd2bde1 100644
--- a/src/repo.h
+++ b/src/repo.h
@@ -38,10 +38,10 @@ typedef struct _Repo {
int idarraysize;
Offset lastoff; /* start of last array in idarraydata */
- Id *rpmdbid; /* solvable side data */
-
Repodata *repodata; /* our stores for non-solvable related data */
unsigned nrepodata; /* number of our stores.. */
+
+ Id *rpmdbid; /* solvable side data: rpm database id */
} Repo;
extern Repo *repo_create(Pool *pool, const char *name);
@@ -216,9 +216,9 @@ typedef struct _Dataiterator
} Dataiterator;
-int datamatcher_init(Datamatcher *ma, const char *match, int flags);
+int datamatcher_init(Datamatcher *ma, const char *match, int flags);
void datamatcher_free(Datamatcher *ma);
-int datamatcher_match(Datamatcher *ma, const char *str);
+int datamatcher_match(Datamatcher *ma, const char *str);
/*
* Dataiterator
@@ -246,18 +246,18 @@ int datamatcher_match(Datamatcher *ma, const char *str);
* keyname: if non-null, limit search to this keyname
* match: if non-null, limit search to this match
*/
-int dataiterator_init(Dataiterator *di, Pool *pool, Repo *repo, Id p, Id keyname, const char *match, int flags);
+int dataiterator_init(Dataiterator *di, Pool *pool, Repo *repo, Id p, Id keyname, const char *match, int flags);
void dataiterator_init_clone(Dataiterator *di, Dataiterator *from);
void dataiterator_set_search(Dataiterator *di, Repo *repo, Id p);
void dataiterator_set_keyname(Dataiterator *di, Id keyname);
-int dataiterator_set_match(Dataiterator *di, const char *match, int flags);
+int dataiterator_set_match(Dataiterator *di, const char *match, int flags);
void dataiterator_prepend_keyname(Dataiterator *di, Id keyname);
void dataiterator_free(Dataiterator *di);
-int dataiterator_step(Dataiterator *di);
+int dataiterator_step(Dataiterator *di);
void dataiterator_setpos(Dataiterator *di);
void dataiterator_setpos_parent(Dataiterator *di);
-int dataiterator_match(Dataiterator *di, Datamatcher *ma);
+int dataiterator_match(Dataiterator *di, Datamatcher *ma);
void dataiterator_skip_attribute(Dataiterator *di);
void dataiterator_skip_solvable(Dataiterator *di);
void dataiterator_skip_repo(Dataiterator *di);
diff --git a/src/rules.c b/src/rules.c
index db39717..af8ca3c 100644
--- a/src/rules.c
+++ b/src/rules.c
@@ -18,6 +18,7 @@
#include <assert.h>
#include "solver.h"
+#include "solver_private.h"
#include "bitmap.h"
#include "pool.h"
#include "poolarch.h"
diff --git a/src/solver.c b/src/solver.c
index 2d70850..e8b35f3 100644
--- a/src/solver.c
+++ b/src/solver.c
@@ -18,6 +18,7 @@
#include <assert.h>
#include "solver.h"
+#include "solver_private.h"
#include "bitmap.h"
#include "pool.h"
#include "util.h"
@@ -1274,7 +1275,6 @@ solver_create(Pool *pool)
queue_init(&solv->learnt_why);
queue_init(&solv->learnt_pool);
queue_init(&solv->branches);
- queue_init(&solv->covenantq);
queue_init(&solv->weakruleq);
queue_init(&solv->ruleassertions);
@@ -1315,7 +1315,6 @@ solver_free(Solver *solv)
queue_free(&solv->recommendations);
queue_free(&solv->orphaned);
queue_free(&solv->branches);
- queue_free(&solv->covenantq);
queue_free(&solv->weakruleq);
queue_free(&solv->ruleassertions);
@@ -2488,7 +2487,7 @@ solver_addjobrule(Solver *solv, Id p, Id d, Id job, int weak)
*
*/
-void
+int
solver_solve(Solver *solv, Queue *job)
{
Pool *pool = solv->pool;
@@ -2511,7 +2510,7 @@ solver_solve(Solver *solv, Queue *job)
POOL_DEBUG(SAT_DEBUG_STATS, "fixsystem=%d updatesystem=%d dosplitprovides=%d, noupdateprovide=%d noinfarchcheck=%d\n", solv->fixsystem, solv->updatesystem, solv->dosplitprovides, solv->noupdateprovide, solv->noinfarchcheck);
POOL_DEBUG(SAT_DEBUG_STATS, "distupgrade=%d distupgrade_removeunsupported=%d\n", solv->distupgrade, solv->distupgrade_removeunsupported);
POOL_DEBUG(SAT_DEBUG_STATS, "allowuninstall=%d, allowdowngrade=%d, allowarchchange=%d, allowvendorchange=%d\n", solv->allowuninstall, solv->allowdowngrade, solv->allowarchchange, solv->allowvendorchange);
- POOL_DEBUG(SAT_DEBUG_STATS, "promoteepoch=%d, novirtualconflicts=%d, allowselfconflicts=%d\n", pool->promoteepoch, pool->novirtualconflicts, pool->allowselfconflicts);
+ POOL_DEBUG(SAT_DEBUG_STATS, "promoteepoch=%d, allowselfconflicts=%d\n", pool->promoteepoch, pool->allowselfconflicts);
POOL_DEBUG(SAT_DEBUG_STATS, "obsoleteusesprovides=%d, implicitobsoleteusesprovides=%d, obsoleteusescolors=%d\n", pool->obsoleteusesprovides, pool->implicitobsoleteusesprovides, pool->obsoleteusescolors);
POOL_DEBUG(SAT_DEBUG_STATS, "dontinstallrecommended=%d, ignorealreadyrecommended=%d, dontshowinstalledrecommended=%d\n", solv->dontinstallrecommended, solv->ignorealreadyrecommended, solv->dontshowinstalledrecommended);
@@ -3005,6 +3004,7 @@ solver_solve(Solver *solv, Queue *job)
POOL_DEBUG(SAT_DEBUG_STATS, "final solver statistics: %d problems, %d learned rules, %d unsolvable\n", solv->problems.count / 2, solv->stats_learned, solv->stats_unsolvable);
POOL_DEBUG(SAT_DEBUG_STATS, "solver_solve took %d ms\n", sat_timems(solve_start));
+ return solv->problems.count ? solv->problems.count / 2 : 0;
}
/***********************************************************************/
@@ -3044,10 +3044,16 @@ solver_calc_installsizechange(Solver *solv)
}
void
+solver_create_state_maps(Solver *solv, Map *installedmap, Map *conflictsmap)
+{
+ pool_create_state_maps(solv->pool, &solv->decisionq, installedmap, conflictsmap);
+}
+
+void
solver_trivial_installable(Solver *solv, Queue *pkgs, Queue *res)
{
Map installedmap;
- solver_create_state_maps(solv, &installedmap, 0);
+ pool_create_state_maps(solv->pool, &solv->decisionq, &installedmap, 0);
pool_trivial_installable_noobsoletesmap(solv->pool, &installedmap, pkgs, res, solv->noobsoletes.size ? &solv->noobsoletes : 0);
map_free(&installedmap);
}
diff --git a/src/solver.h b/src/solver.h
index 16f6daf..cc930e9 100644
--- a/src/solver.h
+++ b/src/solver.h
@@ -36,9 +36,8 @@ typedef int (*VendorCheckCb) (Pool *pool, Solvable *solvable1, Solvable *solvab
typedef void (*UpdateCandidateCb) (Pool *pool, Solvable *solvable, Queue *canditates);
-struct _Solver;
-
-typedef struct _Solver {
+#if 1
+struct _Solver {
Pool *pool; /* back pointer to pool */
Queue job; /* copy of the job we're solving */
@@ -169,7 +168,7 @@ typedef struct _Solver {
* candidates : List of canditates which has to be sorted by the function call
* return candidates: Sorted list of the candidates(first is the best).
*/
- BestSolvableCb bestSolvableCb;
+ BestSolvableCb bestSolvableCb;
/* Checking if two solvables has compatible architectures
*
@@ -178,7 +177,7 @@ typedef struct _Solver {
*
* return 0 it the two solvables has compatible architectures
*/
- ArchCheckCb archCheckCb;
+ ArchCheckCb archCheckCb;
/* Checking if two solvables has compatible vendors
*
@@ -187,7 +186,7 @@ typedef struct _Solver {
*
* return 0 it the two solvables has compatible architectures
*/
- VendorCheckCb vendorCheckCb;
+ VendorCheckCb vendorCheckCb;
/* Evaluate update candidate
*
@@ -197,13 +196,8 @@ typedef struct _Solver {
* candidates : List of candidates (This list depends on other
* restrictions like architecture and vendor policies too)
*/
- UpdateCandidateCb updateCandidateCb;
+ UpdateCandidateCb updateCandidateCb;
-
- /* some strange queue that doesn't belong here */
- Queue covenantq; /* Covenants honored by this solver (generic locks) */
-
-
Map dupmap; /* dup these packages*/
int dupmap_all; /* dup all packages */
Map dupinvolvedmap; /* packages involved in dup process */
@@ -214,7 +208,11 @@ typedef struct _Solver {
Map cleandepsmap; /* try to drop these packages as of cleandeps erases */
Queue *ruleinfoq; /* tmp space for solver_ruleinfo() */
-} Solver;
+};
+
+#endif
+
+typedef struct _Solver Solver;
/*
* queue commands
@@ -292,88 +290,20 @@ typedef struct _Solver {
extern Solver *solver_create(Pool *pool);
extern void solver_free(Solver *solv);
-extern void solver_solve(Solver *solv, Queue *job);
-
-extern void solver_run_sat(Solver *solv, int disablerules, int doweak);
-extern void solver_reset(Solver *solv);
-
-extern int solver_dep_installed(Solver *solv, Id dep);
-extern int solver_splitprovides(Solver *solv, Id dep);
+extern int solver_solve(Solver *solv, Queue *job);
extern void solver_calculate_noobsmap(Pool *pool, Queue *job, Map *noobsmap);
-
-/* obsolete */
-extern SolverRuleinfo solver_problemruleinfo(Solver *solv, Queue *job, Id rid, Id *depp, Id *sourcep, Id *targetp);
+extern void solver_create_state_maps(Solver *solv, Map *installedmap, Map *conflictsmap);
/* XXX: why is this not static? */
Id *solver_create_decisions_obsoletesmap(Solver *solv);
-static inline int
-solver_dep_fulfilled(Solver *solv, Id dep)
-{
- Pool *pool = solv->pool;
- Id p, pp;
-
- if (ISRELDEP(dep))
- {
- Reldep *rd = GETRELDEP(pool, dep);
- if (rd->flags == REL_AND)
- {
- if (!solver_dep_fulfilled(solv, rd->name))
- return 0;
- return solver_dep_fulfilled(solv, rd->evr);
- }
- if (rd->flags == REL_NAMESPACE && rd->name == NAMESPACE_SPLITPROVIDES)
- return solver_splitprovides(solv, rd->evr);
- if (rd->flags == REL_NAMESPACE && rd->name == NAMESPACE_INSTALLED)
- return solver_dep_installed(solv, rd->evr);
- }
- FOR_PROVIDES(p, pp, dep)
- {
- if (solv->decisionmap[p] > 0)
- return 1;
- }
- return 0;
-}
-
-static inline int
-solver_is_supplementing(Solver *solv, Solvable *s)
-{
- Id sup, *supp;
- if (!s->supplements)
- return 0;
- supp = s->repo->idarraydata + s->supplements;
- while ((sup = *supp++) != 0)
- if (solver_dep_fulfilled(solv, sup))
- return 1;
- return 0;
-}
-
-static inline int
-solver_is_enhancing(Solver *solv, Solvable *s)
-{
- Id enh, *enhp;
- if (!s->enhances)
- return 0;
- enhp = s->repo->idarraydata + s->enhances;
- while ((enh = *enhp++) != 0)
- if (solver_dep_fulfilled(solv, enh))
- return 1;
- return 0;
-}
-
void solver_calc_duchanges(Solver *solv, DUChanges *mps, int nmps);
int solver_calc_installsizechange(Solver *solv);
void solver_trivial_installable(Solver *solv, Queue *pkgs, Queue *res);
void solver_find_involved(Solver *solv, Queue *installedq, Solvable *s, Queue *q);
-static inline void
-solver_create_state_maps(Solver *solv, Map *installedmap, Map *conflictsmap)
-{
- pool_create_state_maps(solv->pool, &solv->decisionq, installedmap, conflictsmap);
-}
-
/* iterate over all literals of a rule */
/* WARNING: loop body must not relocate whatprovidesdata, e.g. by
* looking up the providers of a dependency */
diff --git a/src/solver_private.h b/src/solver_private.h
new file mode 100644
index 0000000..a563fa8
--- /dev/null
+++ b/src/solver_private.h
@@ -0,0 +1,251 @@
+/*
+ * Copyright (c) 2011, Novell Inc.
+ *
+ * This program is licensed under the BSD license, read LICENSE.BSD
+ * for further information
+ */
+
+/*
+ * solver_p.h - private functions
+ *
+ */
+
+#ifndef LIBSOLV_SOLVER_P_H
+#define LIBSOLV_SOLVER_P_H
+
+#if 0
+struct _Solver {
+ Pool *pool; /* back pointer to pool */
+ Queue job; /* copy of the job we're solving */
+
+ Transaction trans; /* calculated transaction */
+
+ Repo *installed; /* copy of pool->installed */
+
+ /* list of rules, ordered
+ * rpm rules first, then features, updates, jobs, learnt
+ * see start/end offsets below
+ */
+ Rule *rules; /* all rules */
+ Id nrules; /* [Offset] index of the last rule */
+
+ Queue ruleassertions; /* Queue of all assertion rules */
+
+ /* start/end offset for rule 'areas' */
+
+ Id rpmrules_end; /* [Offset] rpm rules end */
+
+ Id featurerules; /* feature rules start/end */
+ Id featurerules_end;
+
+ Id updaterules; /* policy rules, e.g. keep packages installed or update. All literals > 0 */
+ Id updaterules_end;
+
+ Id jobrules; /* user rules */
+ Id jobrules_end;
+
+ Id infarchrules; /* inferior arch rules */
+ Id infarchrules_end;
+
+ Id duprules; /* dist upgrade rules */
+ Id duprules_end;
+
+ Id choicerules; /* choice rules (always weak) */
+ Id choicerules_end;
+ Id *choicerules_ref;
+
+ Id learntrules; /* learnt rules, (end == nrules) */
+
+ Map noupdate; /* don't try to update these
+ installed solvables */
+ Map noobsoletes; /* ignore obsoletes for these (multiinstall) */
+
+ Map updatemap; /* bring these installed packages to the newest version */
+ int updatemap_all; /* bring all packages to the newest version */
+
+ Map fixmap; /* fix these packages */
+ int fixmap_all; /* fix all packages */
+
+ Queue weakruleq; /* index into 'rules' for weak ones */
+ Map weakrulemap; /* map rule# to '1' for weak rules, 1..learntrules */
+
+ Id *watches; /* Array of rule offsets
+ * watches has nsolvables*2 entries and is addressed from the middle
+ * middle-solvable : decision to conflict, offset point to linked-list of rules
+ * middle+solvable : decision to install: offset point to linked-list of rules
+ */
+
+ Queue ruletojob; /* index into job queue: jobs for which a rule exits */
+
+ /* our decisions: */
+ Queue decisionq; /* >0:install, <0:remove/conflict */
+ Queue decisionq_why; /* index of rule, Offset into rules */
+
+ Id *decisionmap; /* map for all available solvables,
+ * = 0: undecided
+ * > 0: level of decision when installed,
+ * < 0: level of decision when conflict */
+
+ /* learnt rule history */
+ Queue learnt_why;
+ Queue learnt_pool;
+
+ Queue branches;
+ int (*solution_callback)(struct _Solver *solv, void *data);
+ void *solution_callback_data;
+
+ int propagate_index; /* index into decisionq for non-propagated decisions */
+
+ Queue problems; /* list of lists of conflicting rules, < 0 for job rules */
+ Queue solutions; /* refined problem storage space */
+
+ Queue recommendations; /* recommended packages */
+ Queue suggestions; /* suggested packages */
+ Queue orphaned; /* orphaned packages */
+
+ int stats_learned; /* statistic */
+ int stats_unsolvable; /* statistic */
+
+ Map recommendsmap; /* recommended packages from decisionmap */
+ Map suggestsmap; /* suggested packages from decisionmap */
+ int recommends_index; /* recommendsmap/suggestsmap is created up to this level */
+
+ Id *obsoletes; /* obsoletes for each installed solvable */
+ Id *obsoletes_data; /* data area for obsoletes */
+ Id *multiversionupdaters; /* updaters for multiversion packages in updatesystem mode */
+
+ /*-------------------------------------------------------------------------------------------------------------
+ * Solver configuration
+ *-------------------------------------------------------------------------------------------------------------*/
+
+ int fixsystem; /* repair errors in rpm dependency graph */
+ int allowdowngrade; /* allow to downgrade installed solvable */
+ int allowarchchange; /* allow to change architecture of installed solvables */
+ int allowvendorchange; /* allow to change vendor of installed solvables */
+ int allowuninstall; /* allow removal of installed solvables */
+ int updatesystem; /* update all packages to the newest version */
+ int noupdateprovide; /* true: update packages needs not to provide old package */
+ int dosplitprovides; /* true: consider legacy split provides */
+ int dontinstallrecommended; /* true: do not install recommended packages */
+ int ignorealreadyrecommended; /* true: ignore recommended packages that were already recommended by the installed packages */
+ int dontshowinstalledrecommended; /* true: do not show recommended packages that are already installed */
+
+ /* distupgrade also needs updatesystem and dosplitprovides */
+ int distupgrade;
+ int distupgrade_removeunsupported;
+
+ int noinfarchcheck; /* true: do not forbid inferior architectures */
+
+ /* Callbacks for defining the bahaviour of the SAT solver */
+
+ /* Finding best candidate
+ *
+ * Callback definition:
+ * void bestSolvable (Pool *pool, Queue *canditates)
+ * candidates : List of canditates which has to be sorted by the function call
+ * return candidates: Sorted list of the candidates(first is the best).
+ */
+ BestSolvableCb bestSolvableCb;
+
+ /* Checking if two solvables has compatible architectures
+ *
+ * Callback definition:
+ * int archCheck (Pool *pool, Solvable *solvable1, Solvable *solvable2);
+ *
+ * return 0 it the two solvables has compatible architectures
+ */
+ ArchCheckCb archCheckCb;
+
+ /* Checking if two solvables has compatible vendors
+ *
+ * Callback definition:
+ * int vendorCheck (Pool *pool, Solvable *solvable1, Solvable *solvable2);
+ *
+ * return 0 it the two solvables has compatible architectures
+ */
+ VendorCheckCb vendorCheckCb;
+
+ /* Evaluate update candidate
+ *
+ * Callback definition:
+ * void pdateCandidateCb (Pool *pool, Solvable *solvable, Queue *canditates)
+ * solvable : for which updates should be search
+ * candidates : List of candidates (This list depends on other
+ * restrictions like architecture and vendor policies too)
+ */
+ UpdateCandidateCb updateCandidateCb;
+
+ Map dupmap; /* dup these packages*/
+ int dupmap_all; /* dup all packages */
+ Map dupinvolvedmap; /* packages involved in dup process */
+
+ Map droporphanedmap; /* packages to drop in dup mode */
+ int droporphanedmap_all;
+
+ Map cleandepsmap; /* try to drop these packages as of cleandeps erases */
+
+ Queue *ruleinfoq; /* tmp space for solver_ruleinfo() */
+};
+#endif
+
+extern void solver_run_sat(Solver *solv, int disablerules, int doweak);
+extern void solver_reset(Solver *solv);
+
+extern int solver_dep_installed(Solver *solv, Id dep);
+extern int solver_splitprovides(Solver *solv, Id dep);
+
+static inline int
+solver_dep_fulfilled(Solver *solv, Id dep)
+{
+ Pool *pool = solv->pool;
+ Id p, pp;
+
+ if (ISRELDEP(dep))
+ {
+ Reldep *rd = GETRELDEP(pool, dep);
+ if (rd->flags == REL_AND)
+ {
+ if (!solver_dep_fulfilled(solv, rd->name))
+ return 0;
+ return solver_dep_fulfilled(solv, rd->evr);
+ }
+ if (rd->flags == REL_NAMESPACE && rd->name == NAMESPACE_SPLITPROVIDES)
+ return solver_splitprovides(solv, rd->evr);
+ if (rd->flags == REL_NAMESPACE && rd->name == NAMESPACE_INSTALLED)
+ return solver_dep_installed(solv, rd->evr);
+ }
+ FOR_PROVIDES(p, pp, dep)
+ {
+ if (solv->decisionmap[p] > 0)
+ return 1;
+ }
+ return 0;
+}
+
+static inline int
+solver_is_supplementing(Solver *solv, Solvable *s)
+{
+ Id sup, *supp;
+ if (!s->supplements)
+ return 0;
+ supp = s->repo->idarraydata + s->supplements;
+ while ((sup = *supp++) != 0)
+ if (solver_dep_fulfilled(solv, sup))
+ return 1;
+ return 0;
+}
+
+static inline int
+solver_is_enhancing(Solver *solv, Solvable *s)
+{
+ Id enh, *enhp;
+ if (!s->enhances)
+ return 0;
+ enhp = s->repo->idarraydata + s->enhances;
+ while ((enh = *enhp++) != 0)
+ if (solver_dep_fulfilled(solv, enh))
+ return 1;
+ return 0;
+}
+
+#endif /* LIBSOLV_SOLVER_P_H */
diff --git a/src/solverdebug.c b/src/solverdebug.c
index 7cc737e..44d7fca 100644
--- a/src/solverdebug.c
+++ b/src/solverdebug.c
@@ -18,6 +18,7 @@
#include <assert.h>
#include "solver.h"
+#include "solver_private.h"
#include "solverdebug.h"
#include "bitmap.h"
#include "pool.h"