From 4c6908cd35063f06478338d66072b6823ff1ac17 Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Mon, 9 Jan 2012 14:35:26 +0100 Subject: - hide solver internals --- bindings/solv.i | 35 +++++----- examples/p5solv | 24 ++++--- examples/pysolv | 22 +++---- examples/rbsolv | 22 +++---- examples/solv.c | 30 +++++++-- src/CMakeLists.txt | 2 + src/libsolv.ver | 1 + src/repo.h | 2 + src/rules.c | 24 +++++++ src/rules.h | 1 + src/solver.c | 2 +- src/solver.h | 90 ++++++++++++------------- src/solver_private.h | 181 +-------------------------------------------------- src/transaction.h | 2 + tools/patchcheck.c | 1 - 15 files changed, 153 insertions(+), 286 deletions(-) diff --git a/bindings/solv.i b/bindings/solv.i index 39c2ee0..2a47ef0 100644 --- a/bindings/solv.i +++ b/bindings/solv.i @@ -549,20 +549,6 @@ typedef struct _Repo { %nodefaultdtor Solver; typedef struct { Pool * const pool; - bool fixsystem; - bool allowdowngrade; - bool allowarchchange; - bool allowvendorchange; - bool allowuninstall; - bool updatesystem; - bool noupdateprovide; - bool dosplitprovides; - bool dontinstallrecommended; - bool ignorealreadyrecommended; - bool dontshowinstalledrecommended; - bool distupgrade; - bool distupgrade_removeunsupported; - bool noinfarchcheck; } Solver; typedef struct chksum { @@ -1728,8 +1714,10 @@ typedef struct { { for (i = j = 0; i < q.count; i++) { + SolverRuleinfo rclass; probr = q.elements[i]; - if ((probr >= solv->updaterules && probr < solv->updaterules_end) || (probr >= solv->jobrules && probr < solv->jobrules_end)) + rclass = solver_ruleclass(solv, probr); + if (rclass == SOLVER_RULE_UPDATE || rclass == SOLVER_RULE_JOB) continue; q.elements[j++] = probr; } @@ -1932,9 +1920,26 @@ typedef struct { static const int POLICY_ILLEGAL_ARCHCHANGE = POLICY_ILLEGAL_ARCHCHANGE; static const int POLICY_ILLEGAL_VENDORCHANGE = POLICY_ILLEGAL_VENDORCHANGE; + static const int SOLVER_FLAG_ALLOW_DOWNGRADE = SOLVER_FLAG_ALLOW_DOWNGRADE; + static const int SOLVER_FLAG_ALLOW_ARCHCHANGE = SOLVER_FLAG_ALLOW_ARCHCHANGE; + static const int SOLVER_FLAG_ALLOW_VENDORCHANGE = SOLVER_FLAG_ALLOW_VENDORCHANGE; + static const int SOLVER_FLAG_ALLOW_UNINSTALL = SOLVER_FLAG_ALLOW_UNINSTALL; + static const int SOLVER_FLAG_NO_UPDATEPROVIDE = SOLVER_FLAG_NO_UPDATEPROVIDE; + static const int SOLVER_FLAG_SPLITPROVIDES = SOLVER_FLAG_SPLITPROVIDES; + static const int SOLVER_FLAG_IGNORE_RECOMMENDED = SOLVER_FLAG_IGNORE_RECOMMENDED; + static const int SOLVER_FLAG_IGNORE_ALREADY_RECOMMENDED = SOLVER_FLAG_IGNORE_ALREADY_RECOMMENDED; + static const int SOLVER_FLAG_NO_INFARCHCHECK = SOLVER_FLAG_NO_INFARCHCHECK; + ~Solver() { solver_free($self); } + + int set_flag(int flag, int value) { + return solver_set_flag($self, flag, value); + } + int get_flag(int flag) { + return solver_get_flag($self, flag); + } #if defined(SWIGPYTHON) %pythoncode { def solve(self, jobs): diff --git a/examples/p5solv b/examples/p5solv index 804b864..bf3dd67 100755 --- a/examples/p5solv +++ b/examples/p5solv @@ -728,9 +728,9 @@ if ($cmd eq 'list' || $cmd eq 'info') { if ($cmd eq 'install' || $cmd eq 'erase' || $cmd eq 'up' || $cmd eq 'dup' || $cmd eq 'verify') { if (!@jobs) { - if ($cmd eq 'up' || $cmd eq 'verify') { + if ($cmd eq 'up' || $cmd eq 'verify' || $cmd eq 'dup') { push @jobs, $pool->Job($solv::Job::SOLVER_SOLVABLE_ALL, 0); - } elsif ($cmd ne 'dup') { + } else { die("no package matched.\n"); } } @@ -754,17 +754,15 @@ if ($cmd eq 'install' || $cmd eq 'erase' || $cmd eq 'up' || $cmd eq 'dup' || $cm my $solver; while (1) { $solver = $pool->Solver(); - $solver->{'ignorealreadyrecommended'} = 1; - $solver->{'allowuninstall'} = 1 if $cmd eq 'erase'; - if ($cmd eq 'dup' && !@jobs) { - $solver->{'distupgrade'} = 1; - $solver->{'updatesystem'} = 1; - $solver->{'allowdowngrade'} = 1; - $solver->{'allowvendorchange'} = 1; - $solver->{'allowarchchange'} = 1; - $solver->{'dosplitprovides'} = 1; - } elsif ($cmd eq 'up' and @jobs == 1 and $jobs[0]->{'how'} == ($solv::Job::SOLVER_UPDATE | $solv::Job::SOLVER_SOLVABLE_ALL)) { - $solver->{'dosplitprovides'} = 1; + $solver->set_flag($solv::Solver::SOLVER_FLAG_IGNORE_ALREADY_RECOMMENDED, 1); + $solver->set_flag($solv::Solver::SOLVER_FLAG_ALLOW_UNINSTALL, 1) if $cmd eq 'erase'; + if ($cmd eq 'dup' && @jobs == 1 $jobs[0]->{'how'} == ($solv::Job::SOLVER_DISTUPGRADE | $solv::Job::SOLVER_SOLVABLE_ALL)) { + $solver->set_flag($solv::Solver::SOLVER_FLAG_ALLOW_DOWNGRADE, 1); + $solver->set_flag($solv::Solver::SOLVER_FLAG_ALLOW_VENDERCHANGE, 1); + $solver->set_flag($solv::Solver::SOLVER_FLAG_ALLOW_ARCHCHANGE, 1); + $solver->set_flag($solv::Solver::SOLVER_FLAG_SPLITPROVIDES, 1); + } elsif ($cmd eq 'up' && @jobs == 1 && $jobs[0]->{'how'} == ($solv::Job::SOLVER_UPDATE | $solv::Job::SOLVER_SOLVABLE_ALL)) { + $solver->set_flag($solv::Solver::SOLVER_FLAG_SPLITPROVIDES, 1); } my @problems = $solver->solve(\@jobs); last unless @problems; diff --git a/examples/pysolv b/examples/pysolv index f129dce..1422027 100755 --- a/examples/pysolv +++ b/examples/pysolv @@ -823,10 +823,8 @@ if cmd == 'list' or cmd == 'info': if cmd == 'install' or cmd == 'erase' or cmd == 'up' or cmd == 'dup' or cmd == 'verify': if not jobs: - if cmd == 'up' or cmd == 'verify': + if cmd == 'up' or cmd == 'verify' or cmd == 'dup': jobs = [ pool.Job(Job.SOLVER_SOLVABLE_ALL, 0) ] - elif cmd == 'dup': - pass else: print "no package matched." sys.exit(1) @@ -850,18 +848,16 @@ if cmd == 'install' or cmd == 'erase' or cmd == 'up' or cmd == 'dup' or cmd == ' solver = None while True: solver = pool.Solver() - solver.ignorealreadyrecommended = True + solver.set_flag(Solver.SOLVER_FLAG_IGNORE_ALREADY_RECOMMENDED, 1); if cmd == 'erase': - solver.allowuninstall = True - if cmd == 'dup' and not jobs: - solver.distupgrade = True - solver.updatesystem = True - solver.allowdowngrade = True - solver.allowvendorchange = True - solver.allowarchchange = True - solver.dosplitprovides = True + solver.set_flag(Solver.SOLVER_FLAG_ALLOW_UNINSTALL, 1); + if cmd == 'dup' and len(jobs) == 1 and jobs[0].how == (Job.SOLVER_DISTUPGRADE | Job.SOLVER_SOLVABLE_ALL): + solver.set_flag(Solver.SOLVER_FLAG_ALLOW_DOWNGRADE, 1); + solver.set_flag(Solver.SOLVER_FLAG_ALLOW_VENDORCHANGE, 1); + solver.set_flag(Solver.SOLVER_FLAG_ALLOW_ARCHCHANGE, 1); + solver.set_flag(Solver.SOLVER_FLAG_SPLITPROVIDES, 1); if cmd == 'up' and len(jobs) == 1 and jobs[0].how == (Job.SOLVER_UPDATE | Job.SOLVER_SOLVABLE_ALL): - solver.dosplitprovides = True + solver.set_flag(Solver.SOLVER_FLAG_SPLITPROVIDES, 1); problems = solver.solve(jobs) if not problems: break diff --git a/examples/rbsolv b/examples/rbsolv index 2e206a0..d12b8a1 100755 --- a/examples/rbsolv +++ b/examples/rbsolv @@ -728,9 +728,9 @@ end if cmd == 'install' || cmd == 'erase' || cmd == 'up' || cmd == 'dup' || cmd == 'verify' if jobs.empty? - if cmd == 'up' || cmd == 'verify' + if cmd == 'up' || cmd == 'verify' || cmd == 'dup' jobs = [ pool.Job(Solv::Job::SOLVER_SOLVABLE_ALL, 0) ] - elsif cmd != 'dup' + else abort("no package matched.") end end @@ -756,17 +756,15 @@ if cmd == 'install' || cmd == 'erase' || cmd == 'up' || cmd == 'dup' || cmd == ' #pool.set_debuglevel(1) while true solver = pool.Solver - solver.ignorealreadyrecommended = true - solver.allowuninstall = true if cmd == 'erase' - if cmd == 'dup' && jobs.empty? - solver.distupgrade = true - solver.updatesystem = true - solver.allowdowngrade = true - solver.allowvendorchange = true - solver.allowarchchange = true - solver.dosplitprovides = true + solver.set_flag(Solv::Solver::SOLVER_FLAG_IGNORE_ALREADY_RECOMMENDED, 1) + solver.set_flag(Solv::Solver::SOLVER_FLAG_ALLOW_UNINSTALL, 1) if cmd == 'erase' + if cmd == 'up' && jobs.length == 1 && jobs[0].how == (Solv::Job::SOLVER_DISTUPGRADE | Solv::Job::SOLVER_SOLVABLE_ALL) + solver.set_flag(Solv::Solver::SOLVER_FLAG_ALLOW_DOWNGRADE, 1) + solver.set_flag(Solv::Solver::SOLVER_FLAG_ALLOW_VENDORCHANGE, 1) + solver.set_flag(Solv::Solver::SOLVER_FLAG_ALLOW_ARCHCHANGE, 1) + solver.set_flag(Solv::Solver::SOLVER_FLAG_SPLITPROVIDES, 1) elsif cmd == 'up' && jobs.length == 1 && jobs[0].how == (Solv::Job::SOLVER_UPDATE | Solv::Job::SOLVER_SOLVABLE_ALL) - solver.dosplitprovides = true + solver.set_flag(Solv::Solver::SOLVER_FLAG_SPLITPROVIDES, 1) end problems = solver.solve(jobs) break if problems.empty? diff --git a/examples/solv.c b/examples/solv.c index cb5992c..bf6a622 100644 --- a/examples/solv.c +++ b/examples/solv.c @@ -2917,8 +2917,27 @@ main(int argc, char **argv) job.elements[i] |= SOLVER_CLEANDEPS; } - if (mainmode == MODE_DISTUPGRADE && allpkgs && repofilter) - queue_push2(&job, SOLVER_DISTUPGRADE|SOLVER_SOLVABLE_REPO, repofilter); + if (mainmode == MODE_DISTUPGRADE && allpkgs) + { + if (repofilter) + queue_push2(&job, SOLVER_DISTUPGRADE|SOLVER_SOLVABLE_REPO, repofilter); + else + queue_push2(&job, SOLVER_DISTUPGRADE|SOLVER_SOLVABLE_ALL, 0); + } + if (mainmode == MODE_UPDATE && allpkgs) + { + if (repofilter) + queue_push2(&job, SOLVER_UPDATE|SOLVER_SOLVABLE_REPO, repofilter); + else + queue_push2(&job, SOLVER_UPDATE|SOLVER_SOLVABLE_ALL, 0); + } + if (mainmode == MODE_VERIFY && allpkgs) + { + if (repofilter) + queue_push2(&job, SOLVER_VERIFY|SOLVER_SOLVABLE_REPO, repofilter); + else + queue_push2(&job, SOLVER_VERIFY|SOLVER_SOLVABLE_ALL, 0); + } // multiversion test // queue_push2(&job, SOLVER_NOOBSOLETES|SOLVER_SOLVABLE_NAME, pool_str2id(pool, "kernel-pae", 1)); @@ -2939,15 +2958,14 @@ rerunsolver: solv = solver_create(pool); solver_set_flag(solv, SOLVER_FLAG_IGNORE_ALREADY_RECOMMENDED, 1); - solv->updatesystem = allpkgs && !repofilter && (mainmode == MODE_UPDATE || mainmode == MODE_DISTUPGRADE); - solv->dosplitprovides = solv->updatesystem; - solv->fixsystem = allpkgs && !repofilter && mainmode == MODE_VERIFY; + if (allpkgs && !repofilter && mainmode == MODE_UPDATE) + solver_set_flag(solv, SOLVER_FLAG_SPLITPROVIDES, 1); if (mainmode == MODE_DISTUPGRADE && allpkgs && !repofilter) { - solv->distupgrade = 1; solver_set_flag(solv, SOLVER_FLAG_ALLOW_DOWNGRADE, 1); solver_set_flag(solv, SOLVER_FLAG_ALLOW_ARCHCHANGE, 1); solver_set_flag(solv, SOLVER_FLAG_ALLOW_VENDORCHANGE, 1); + solver_set_flag(solv, SOLVER_FLAG_SPLITPROVIDES, 1); } if (mainmode == MODE_ERASE || mainmode == MODE_ERASECLEAN) solver_set_flag(solv, SOLVER_FLAG_ALLOW_UNINSTALL, 1); /* don't nag */ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6fe169d..e118dc7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -11,6 +11,8 @@ IF (HAVE___QSORT_R) ADD_DEFINITIONS (-DHAVE___QSORT_R=1) ENDIF (HAVE___QSORT_R) +ADD_DEFINITIONS (-DLIBSOLV_INTERNAL=1) + SET (libsolv_SRCS bitmap.c poolarch.c poolvendor.c poolid.c strpool.c dirpool.c solver.c solverdebug.c repo_solv.c evr.c pool.c diff --git a/src/libsolv.ver b/src/libsolv.ver index c6e399d..4a0fc25 100644 --- a/src/libsolv.ver +++ b/src/libsolv.ver @@ -279,6 +279,7 @@ SOLV_1.0 { solver_problemruleinfo2str; solver_rule2job; solver_rule2jobidx; + solver_ruleclass; solver_ruleinfo; solver_ruleliterals; solver_samerule; diff --git a/src/repo.h b/src/repo.h index ed52d0c..ffc71d8 100644 --- a/src/repo.h +++ b/src/repo.h @@ -43,6 +43,7 @@ typedef struct _Repo { Id *rpmdbid; /* solvable side data: rpm database id */ +#ifdef LIBSOLV_INTERNAL Offset lastoff; /* start of last array in idarraydata */ Hashtable lastidhash; /* hash to speed up repo_addid_dep */ @@ -50,6 +51,7 @@ typedef struct _Repo { int lastidhash_idarraysize; int lastmarker; Offset lastmarkerpos; +#endif /* LIBSOLV_INTERNAL */ } Repo; extern Repo *repo_create(Pool *pool, const char *name); diff --git a/src/rules.c b/src/rules.c index a423600..83426f8 100644 --- a/src/rules.c +++ b/src/rules.c @@ -1921,6 +1921,30 @@ solver_ruleinfo(Solver *solv, Id rid, Id *fromp, Id *top, Id *depp) return SOLVER_RULE_UNKNOWN; } +SolverRuleinfo +solver_ruleclass(Solver *solv, Id rid) +{ + if (rid <= 0) + return SOLVER_RULE_UNKNOWN; + if (rid > 0 && rid < solv->rpmrules_end) + return SOLVER_RULE_RPM; + if (rid >= solv->jobrules && rid < solv->jobrules_end) + return SOLVER_RULE_JOB; + if (rid >= solv->updaterules && rid < solv->updaterules_end) + return SOLVER_RULE_UPDATE; + if (rid >= solv->featurerules && rid < solv->featurerules_end) + return SOLVER_RULE_FEATURE; + if (rid >= solv->duprules && rid < solv->duprules_end) + return SOLVER_RULE_DISTUPGRADE; + if (rid >= solv->infarchrules && rid < solv->infarchrules_end) + return SOLVER_RULE_INFARCH; + if (rid >= solv->choicerules && rid < solv->choicerules_end) + return SOLVER_RULE_CHOICE; + if (rid >= solv->learntrules) + return SOLVER_RULE_LEARNT; + return SOLVER_RULE_UNKNOWN; +} + void solver_ruleliterals(Solver *solv, Id rid, Queue *q) { diff --git a/src/rules.h b/src/rules.h index d954a95..43a1786 100644 --- a/src/rules.h +++ b/src/rules.h @@ -125,6 +125,7 @@ extern void solver_reenablepolicyrules(struct _Solver *solv, int jobidx); /* rule info */ extern int solver_allruleinfos(struct _Solver *solv, Id rid, Queue *rq); extern SolverRuleinfo solver_ruleinfo(struct _Solver *solv, Id rid, Id *fromp, Id *top, Id *depp); +extern SolverRuleinfo solver_ruleclass(struct _Solver *solv, Id rid); extern void solver_ruleliterals(struct _Solver *solv, Id rid, Queue *q); extern int solver_rule2jobidx(struct _Solver *solv, Id rid); extern Id solver_rule2job(struct _Solver *solv, Id rid, Id *whatp); diff --git a/src/solver.c b/src/solver.c index 10d3069..fd80677 100644 --- a/src/solver.c +++ b/src/solver.c @@ -3373,7 +3373,7 @@ solver_describe_weakdep_decision(Solver *solv, Id p, Queue *whyq) } if (!found) { - /* hard case, just note with no package */ + /* hard case, just note dependency with no package */ queue_push(whyq, SOLVER_REASON_SUPPLEMENTED); queue_push2(whyq, 0, sup); } diff --git a/src/solver.h b/src/solver.h index 0e6722a..70beff7 100644 --- a/src/solver.h +++ b/src/solver.h @@ -30,17 +30,59 @@ extern "C" { * Callback definitions in order to "overwrite" the policies by an external application. */ -typedef void (*BestSolvableCb) (Pool *pool, Queue *canditates); +typedef void (*BestSolvableCb) (Pool *pool, Queue *canditates); typedef int (*ArchCheckCb) (Pool *pool, Solvable *solvable1, Solvable *solvable2); typedef int (*VendorCheckCb) (Pool *pool, Solvable *solvable1, Solvable *solvable2); typedef void (*UpdateCandidateCb) (Pool *pool, Solvable *solvable, Queue *canditates); -#if 1 struct _Solver { Pool *pool; /* back pointer to pool */ Queue job; /* copy of the job we're solving */ + int (*solution_callback)(struct _Solver *solv, void *data); + void *solution_callback_data; + + /* Callbacks for defining the bahaviour of the 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 UpdateCandidateCb (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; + +#ifdef LIBSOLV_INTERNAL Repo *installed; /* copy of pool->installed */ /* list of rules, ordered @@ -118,9 +160,6 @@ struct _Solver { 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 */ @@ -163,44 +202,6 @@ struct _Solver { 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 */ @@ -212,10 +213,9 @@ struct _Solver { Map cleandepsmap; /* try to drop these packages as of cleandeps erases */ Queue *ruleinfoq; /* tmp space for solver_ruleinfo() */ +#endif /* LIBSOLV_INTERNAL */ }; -#endif - typedef struct _Solver Solver; /* diff --git a/src/solver_private.h b/src/solver_private.h index cbe3272..8aeea18 100644 --- a/src/solver_private.h +++ b/src/solver_private.h @@ -6,192 +6,13 @@ */ /* - * solver_p.h - private functions + * solver_private.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 */ - - 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 */ - - int decisioncnt_update; - int decisioncnt_keep; - int decisioncnt_resolve; - int decisioncnt_weak; - int decisioncnt_orphan; - - /* 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); diff --git a/src/transaction.h b/src/transaction.h index a5d3015..2b55331 100644 --- a/src/transaction.h +++ b/src/transaction.h @@ -30,12 +30,14 @@ typedef struct _Transaction { Queue steps; /* the transaction steps */ +#ifdef LIBSOLV_INTERNAL Queue transaction_info; Id *transaction_installed; Map transactsmap; Map noobsmap; struct _TransactionOrderdata *orderdata; +#endif } Transaction; diff --git a/tools/patchcheck.c b/tools/patchcheck.c index 28fa3f9..1414a2b 100644 --- a/tools/patchcheck.c +++ b/tools/patchcheck.c @@ -565,7 +565,6 @@ main(int argc, char **argv) c.instrepo->start = c.repo->start; c.instrepo->end = c.repo->end; c.instrepo->nsolvables = c.repo->nsolvables; /* sic! */ - c.instrepo->lastoff = c.repo->lastoff; /* sic! */ pool_set_installed(pool, c.instrepo); pool_createwhatprovides(pool); -- cgit v1.2.3