[zypp-commit] r9801 - in /trunk/sat-solver/src: solver.c solver.h solverdebug.c
Author: mlschroe Date: Wed Apr 23 11:13:14 2008 New Revision: 9801 URL: http://svn.opensuse.org/viewcvs/zypp?rev=9801&view=rev Log: - add "showinstalledrecommended" option to make the solver put installed packages on the suggestions/recommendations queues Modified: trunk/sat-solver/src/solver.c trunk/sat-solver/src/solver.h trunk/sat-solver/src/solverdebug.c Modified: trunk/sat-solver/src/solver.c URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/solver.c?rev=9801&r1=9800&r2=9801&view=diff ============================================================================== --- trunk/sat-solver/src/solver.c (original) +++ trunk/sat-solver/src/solver.c Wed Apr 23 11:13:14 2008 @@ -3592,11 +3592,11 @@ /* find recommended packages */ /* if redoq.count == 0 we already found all recommended in the * solver run */ - if (redoq.count || solv->dontinstallrecommended) + if (redoq.count || solv->dontinstallrecommended || solv->showinstalledrecommended) { Id rec, *recp, p, *pp; - /* create map of all suggests that are still open */ + /* create map of all recommened packages */ solv->recommends_index = -1; MAPZERO(&solv->recommendsmap); for (i = 0; i < solv->decisionq.count; i++) @@ -3614,7 +3614,15 @@ if (solv->decisionmap[p] > 0) break; if (p) - continue; /* p != 0: already fulfilled */ + { + if (solv->showinstalledrecommended) + { + FOR_PROVIDES(p, pp, rec) + if (solv->decisionmap[p] > 0) + MAPSET(&solv->recommendsmap, p); + } + continue; /* p != 0: already fulfilled */ + } FOR_PROVIDES(p, pp, rec) MAPSET(&solv->recommendsmap, p); } @@ -3622,7 +3630,9 @@ } for (i = 1; i < pool->nsolvables; i++) { - if (solv->decisionmap[i] != 0) + if (solv->decisionmap[i] < 0) + continue; + if (solv->decisionmap[i] > 0 && !solv->showinstalledrecommended) continue; s = pool->solvables + i; if (!MAPTST(&solv->recommendsmap, i)) @@ -3666,7 +3676,15 @@ if (solv->decisionmap[p] > 0) break; if (p) - continue; /* already fulfilled */ + { + if (solv->showinstalledrecommended) + { + FOR_PROVIDES(p, pp, sug) + if (solv->decisionmap[p] > 0) + MAPSET(&solv->suggestsmap, p); + } + continue; /* already fulfilled */ + } FOR_PROVIDES(p, pp, sug) MAPSET(&solv->suggestsmap, p); } @@ -3674,7 +3692,9 @@ } for (i = 1; i < pool->nsolvables; i++) { - if (solv->decisionmap[i] != 0) + if (solv->decisionmap[i] < 0) + continue; + if (solv->decisionmap[i] > 0 && !solv->showinstalledrecommended) continue; s = pool->solvables + i; if (!MAPTST(&solv->suggestsmap, i)) Modified: trunk/sat-solver/src/solver.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/solver.h?rev=9801&r1=9800&r2=9801&view=diff ============================================================================== --- trunk/sat-solver/src/solver.h (original) +++ trunk/sat-solver/src/solver.h Wed Apr 23 11:13:14 2008 @@ -113,8 +113,6 @@ Id *obsoletes; /* obsoletes for each installed solvable */ Id *obsoletes_data; /* data area for obsoletes */ - Queue covenantq; /* Covenants honored by this solver (generic locks) */ - /*------------------------------------------------------------------------------------------------------------- * Solver configuration *-------------------------------------------------------------------------------------------------------------*/ @@ -130,6 +128,7 @@ 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 showinstalledrecommended; /* true: add recommened packages that are already installed to the lists */ /* Callbacks for defining the bahaviour of the SAT solver */ @@ -170,6 +169,11 @@ */ UpdateCandidateCb updateCandidateCb; + + /* some strange queue that doesn't belong here */ + + Queue covenantq; /* Covenants honored by this solver (generic locks) */ + } Solver; Modified: trunk/sat-solver/src/solverdebug.c URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/solverdebug.c?rev=9801&r1=9800&r2=9801&view=diff ============================================================================== --- trunk/sat-solver/src/solverdebug.c (original) +++ trunk/sat-solver/src/solverdebug.c Wed Apr 23 11:13:14 2008 @@ -314,7 +314,15 @@ for (i = 0; i < solv->recommendations.count; i++) { s = pool->solvables + solv->recommendations.elements[i]; - POOL_DEBUG(SAT_DEBUG_RESULT, "- %s%s\n", solvable2str(pool, s), solv->decisionmap[solv->recommendations.elements[i]] > 0 ? " (selected)" : ""); + if (solv->decisionmap[solv->recommendations.elements[i]] > 0) + { + if (installed && s->repo == installed) + POOL_DEBUG(SAT_DEBUG_RESULT, "- %s (installed)\n", solvable2str(pool, s)); + else + POOL_DEBUG(SAT_DEBUG_RESULT, "- %s (selected)\n", solvable2str(pool, s)); + } + else + POOL_DEBUG(SAT_DEBUG_RESULT, "- %s\n", solvable2str(pool, s)); } } @@ -324,7 +332,15 @@ for (i = 0; i < solv->suggestions.count; i++) { s = pool->solvables + solv->suggestions.elements[i]; - POOL_DEBUG(SAT_DEBUG_RESULT, "- %s\n", solvable2str(pool, s)); + if (solv->decisionmap[solv->suggestions.elements[i]] > 0) + { + if (installed && s->repo == installed) + POOL_DEBUG(SAT_DEBUG_RESULT, "- %s (installed)\n", solvable2str(pool, s)); + else + POOL_DEBUG(SAT_DEBUG_RESULT, "- %s (selected)\n", solvable2str(pool, s)); + } + else + POOL_DEBUG(SAT_DEBUG_RESULT, "- %s\n", solvable2str(pool, s)); } } } -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org
participants (1)
-
mlschroe@svn.opensuse.org