From 4e6ff242049186fc9279a06036ca371d478412b5 Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Thu, 27 Mar 2008 16:58:23 +0000 Subject: [PATCH] - truly restart when analyze_unsolvable is hit (fixes #368209) - fix some indentation --- src/policy.c | 26 +++++++++++++------------- src/solver.c | 16 +++++++--------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/src/policy.c b/src/policy.c index ad7bb83..16b48e2 100644 --- a/src/policy.c +++ b/src/policy.c @@ -312,9 +312,9 @@ void prune_best_arch_name_version(Solver *solv, Pool *pool, Queue *plist) { if (solv && solv->bestSolvableCb) - { /* The application is responsible for */ - return solv->bestSolvableCb (solv->pool, plist); - } + { /* The application is responsible for */ + return solv->bestSolvableCb(solv->pool, plist); + } if (plist->count > 1) prune_to_best_arch(pool, plist); @@ -335,7 +335,7 @@ policy_filter_unwanted(Solver *solv, Queue *plist, Id inst, int mode) if (inst) queue_push(plist, inst); - prune_best_arch_name_version (solv, pool, plist); + prune_best_arch_name_version(solv, pool, plist); } @@ -346,9 +346,9 @@ policy_illegal_archchange(Solver *solv, Solvable *s1, Solvable *s2) Id a1 = s1->arch, a2 = s2->arch; if (solv && solv->archCheckCb) - { /* The application is responsible for */ - return solv->archCheckCb (solv->pool, s1, s2); - } + { /* The application is responsible for */ + return solv->archCheckCb(solv->pool, s1, s2); + } /* we allow changes to/from noarch */ if (a1 == a2 || a1 == ARCH_NOARCH || a2 == ARCH_NOARCH) @@ -369,9 +369,9 @@ policy_illegal_vendorchange(Solver *solv, Solvable *s1, Solvable *s2) Id vendormask1, vendormask2; if (solv && solv->vendorCheckCb) - { /* The application is responsible for */ - return solv->vendorCheckCb (solv->pool, s1, s2); - } + { /* The application is responsible for */ + return solv->vendorCheckCb(solv->pool, s1, s2); + } if (s1->vendor == s2->vendor) return 0; @@ -397,9 +397,9 @@ policy_findupdatepackages(Solver *solv, Solvable *s, Queue *qs, int allowall) queue_empty(qs); if (solv && solv->updateCandidateCb) - { /* The application is responsible for */ - return solv->updateCandidateCb (solv->pool, s, qs); - } + { /* The application is responsible for */ + return solv->updateCandidateCb(solv->pool, s, qs); + } /* * s = solvable ptr diff --git a/src/solver.c b/src/solver.c index be80d82..c9fc82f 100644 --- a/src/solver.c +++ b/src/solver.c @@ -1398,7 +1398,7 @@ propagate(Solver *solv, int level) pkg = -solv->decisionq.elements[solv->propagate_index++]; IF_POOLDEBUG (SAT_DEBUG_PROPAGATE) { - POOL_DEBUG(SAT_DEBUG_PROPAGATE, "popagate for decision %d level %d\n", -pkg, level); + POOL_DEBUG(SAT_DEBUG_PROPAGATE, "propagate for decision %d level %d\n", -pkg, level); printruleelement(solv, SAT_DEBUG_PROPAGATE, 0, -pkg); if (0) printWatches(solv, SAT_DEBUG_SCHUBI); @@ -2189,16 +2189,11 @@ run_solver(Solver *solv, int disablerules, int doweak) { /* try to keep as many packages as possible */ POOL_DEBUG(SAT_DEBUG_STATS, "installing system packages\n"); - for (i = solv->installed->start, n = 0; ; i++) + for (i = solv->installed->start; i < solv->installed->end; i++) { - if (n == solv->installed->nsolvables) - break; - if (i == solv->installed->end) - i = solv->installed->start; s = pool->solvables + i; if (s->repo != solv->installed) continue; - n++; if (solv->decisionmap[i] != 0) continue; POOL_DEBUG(SAT_DEBUG_PROPAGATE, "keeping %s\n", solvable2str(pool, s)); @@ -2210,15 +2205,18 @@ run_solver(Solver *solv, int disablerules, int doweak) return; } if (level <= olevel) - n = 0; + break; } + if (i < solv->installed->end) + continue; } if (solv->weaksystemrules) { POOL_DEBUG(SAT_DEBUG_STATS, "installing weak system packages\n"); for (i = solv->installed->start; i < solv->installed->end; i++) { - if (pool->solvables[i].repo != solv->installed) + s = pool->solvables + i; + if (s->repo != solv->installed) continue; if (solv->decisionmap[i] > 0 || (solv->decisionmap[i] < 0 && solv->weaksystemrules[i - solv->installed->start] == 0)) continue; -- 2.7.4