Author: mlschroe Date: Tue Apr 15 19:11:26 2008 New Revision: 9657 URL: http://svn.opensuse.org/viewcvs/zypp?rev=9657&view=rev Log: - catch self conflicts (configurable) Modified: trunk/sat-solver/src/solver.c trunk/sat-solver/src/solver.h Modified: trunk/sat-solver/src/solver.c URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/solver.c?rev=9657&r1=9656&r2=9657&view=diff ============================================================================== --- trunk/sat-solver/src/solver.c (original) +++ trunk/sat-solver/src/solver.c Tue Apr 15 19:11:26 2008 @@ -1190,6 +1190,8 @@ /* dontfix: dont care about conflicts with already installed packs */ if (dontfix && pool->solvables[p].repo == installed) continue; + if (p == n && !solv->allowselfconflicts) + p = 0; /* make it a negative assertion */ /* rule: -n|-p: either solvable _or_ provider of conflict */ addrule(solv, -n, -p); } @@ -3029,9 +3031,22 @@ if (*dp == 0) break; } - assert(req); - *depp = req; - return SOLVER_PROBLEM_NOTHING_PROVIDES_DEP; + if (req) + { + *depp = req; + return SOLVER_PROBLEM_NOTHING_PROVIDES_DEP; + } + assert(!solv->allowselfconflicts); + assert(s->conflicts); + conp = s->repo->idarraydata + s->conflicts; + while ((con = *conp++) != 0) + FOR_PROVIDES(p, pp, con) + if (p == -r->p) + { + *depp = con; + return SOLVER_PROBLEM_SELF_CONFLICT; + } + assert(0); } s = pool->solvables - r->p; if (installed && !solv->fixsystem && s->repo == installed) @@ -3284,6 +3299,10 @@ s = pool_id2solvable(pool, source); POOL_DEBUG(SAT_DEBUG_RESULT, "package %s requires %s, but none of the providers can be installed\n", solvable2str(pool, s), dep2str(pool, dep)); return; + case SOLVER_PROBLEM_SELF_CONFLICT: + s = pool_id2solvable(pool, source); + POOL_DEBUG(SAT_DEBUG_RESULT, "package %s conflicts with %s provided by itself\n", solvable2str(pool, s), dep2str(pool, dep)); + return; } } Modified: trunk/sat-solver/src/solver.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/solver.h?rev=9657&r1=9656&r2=9657&view=diff ============================================================================== --- trunk/sat-solver/src/solver.h (original) +++ trunk/sat-solver/src/solver.h Tue Apr 15 19:11:26 2008 @@ -122,6 +122,7 @@ int allowuninstall; /* allow removal of installed solvables */ int updatesystem; /* distupgrade */ int allowvirtualconflicts; /* false: conflicts on package name, true: conflicts on package provides */ + int allowselfconflicts; /* true: packages wich conflict with itself are installable */ 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 */ @@ -195,7 +196,8 @@ SOLVER_PROBLEM_SAME_NAME, SOLVER_PROBLEM_PACKAGE_CONFLICT, SOLVER_PROBLEM_PACKAGE_OBSOLETES, - SOLVER_PROBLEM_DEP_PROVIDERS_NOT_INSTALLABLE + SOLVER_PROBLEM_DEP_PROVIDERS_NOT_INSTALLABLE, + SOLVER_PROBLEM_SELF_CONFLICT } SolverProbleminfo; -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org