int obsoleteusesprovides; /* true: obsoletes are matched against provides, not names */
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
static inline Repo *pool_id2repo(Pool *pool, Id repoid)
{
- return pool->repos[repoid - 1];
+ return repoid ? pool->repos[repoid - 1] : 0;
}
static inline int pool_installable(const Pool *pool, Solvable *s)
/*
* special multiversion patch conflict handling:
- * a patch conflict is also satisfied, if some other
+ * a patch conflict is also satisfied if some other
* version with the same name/arch that doesn't conflict
- * get's installed. The generated rule is thus:
+ * gets installed. The generated rule is thus:
* -patch|-cpack|opack1|opack2|...
*/
static Id
}
/*-----------------------------------------
- * check obsoletes if not installed
- * (only installation will trigger the obsoletes in rpm)
+ * check obsoletes and implicit obsoletes of a package
+ * if ignoreinstalledsobsoletes is not set, we're also checking
+ * obsoletes of installed packages (like newer rpm versions)
*/
- if (!installed || pool->solvables[n].repo != installed)
- { /* not installed */
+ if ((!installed || s->repo != installed) || !pool->noinstalledobsoletes)
+ {
int noobs = solv->noobsoletes.size && MAPTST(&solv->noobsoletes, n);
+ int isinstalled = (installed && s->repo == installed);
if (s->obsoletes && !noobs)
{
obsp = s->repo->idarraydata + s->obsoletes;
FOR_PROVIDES(p, pp, obs)
{
Solvable *ps = pool->solvables + p;
+ if (p == n)
+ continue;
+ if (isinstalled && dontfix && ps->repo == installed)
+ continue; /* don't repair installed/installed problems */
if (!pool->obsoleteusesprovides /* obsoletes are matched names, not provides */
&& !pool_match_nevr(pool, ps, obs))
continue;
if (pool->obsoleteusescolors && !pool_colormatch(pool, s, ps))
continue;
- addrpmrule(solv, -n, -p, SOLVER_RULE_RPM_PACKAGE_OBSOLETES, obs);
+ if (!isinstalled)
+ addrpmrule(solv, -n, -p, SOLVER_RULE_RPM_PACKAGE_OBSOLETES, obs);
+ else
+ addrpmrule(solv, -n, -p, SOLVER_RULE_RPM_INSTALLEDPKG_OBSOLETES, obs);
}
}
}
- FOR_PROVIDES(p, pp, s->name)
+ /* check implicit obsoletes
+ * for installed packages we only need to check installed/installed problems (and
+ * only when dontfix is not set), as the others are picked up when looking at the
+ * uninstalled package.
+ */
+ if (!isinstalled || !dontfix)
{
- Solvable *ps = pool->solvables + p;
- /* we still obsolete packages with same nevra, like rpm does */
- /* (actually, rpm mixes those packages. yuck...) */
- if (noobs && (s->name != ps->name || s->evr != ps->evr || s->arch != ps->arch))
- continue;
- if (!pool->implicitobsoleteusesprovides && s->name != ps->name)
- continue;
- if (pool->obsoleteusescolors && !pool_colormatch(pool, s, ps))
- continue;
- if (s->name == ps->name)
- addrpmrule(solv, -n, -p, SOLVER_RULE_RPM_SAME_NAME, 0);
- else
- addrpmrule(solv, -n, -p, SOLVER_RULE_RPM_IMPLICIT_OBSOLETES, s->name);
+ FOR_PROVIDES(p, pp, s->name)
+ {
+ Solvable *ps = pool->solvables + p;
+ if (p == n)
+ continue;
+ if (isinstalled && ps->repo != installed)
+ continue;
+ /* we still obsolete packages with same nevra, like rpm does */
+ /* (actually, rpm mixes those packages. yuck...) */
+ if (noobs && (s->name != ps->name || s->evr != ps->evr || s->arch != ps->arch))
+ continue;
+ if (!pool->implicitobsoleteusesprovides && s->name != ps->name)
+ continue;
+ if (pool->obsoleteusescolors && !pool_colormatch(pool, s, ps))
+ continue;
+ if (s->name == ps->name)
+ addrpmrule(solv, -n, -p, SOLVER_RULE_RPM_SAME_NAME, 0);
+ else
+ addrpmrule(solv, -n, -p, SOLVER_RULE_RPM_IMPLICIT_OBSOLETES, s->name);
+ }
}
}
SOLVER_RULE_RPM_SAME_NAME,
SOLVER_RULE_RPM_PACKAGE_OBSOLETES,
SOLVER_RULE_RPM_IMPLICIT_OBSOLETES,
+ SOLVER_RULE_RPM_INSTALLEDPKG_OBSOLETES,
SOLVER_RULE_UPDATE = 0x200,
SOLVER_RULE_FEATURE = 0x300,
SOLVER_RULE_JOB = 0x400,
queue_free(&pkgs);
}
-void
-solver_printprobleminfo(Solver *solv, Id problem)
+static void
+solver_printproblemruleinfo(Solver *solv, Id probr)
{
Pool *pool = solv->pool;
- Id probr;
Id dep, source, target;
- probr = solver_findproblemrule(solv, problem);
switch (solver_ruleinfo(solv, probr, &source, &target, &dep))
{
case SOLVER_RULE_DISTUPGRADE:
case SOLVER_RULE_RPM_PACKAGE_OBSOLETES:
POOL_DEBUG(SAT_DEBUG_RESULT, "package %s obsoletes %s provided by %s\n", solvid2str(pool, source), dep2str(pool, dep), solvid2str(pool, target));
return;
+ case SOLVER_RULE_RPM_INSTALLEDPKG_OBSOLETES:
+ POOL_DEBUG(SAT_DEBUG_RESULT, "installed package %s obsoletes %s provided by %s\n", solvid2str(pool, source), dep2str(pool, dep), solvid2str(pool, target));
+ return;
case SOLVER_RULE_RPM_IMPLICIT_OBSOLETES:
POOL_DEBUG(SAT_DEBUG_RESULT, "package %s implicitely obsoletes %s provided by %s\n", solvid2str(pool, source), dep2str(pool, dep), solvid2str(pool, target));
return;
}
void
+solver_printprobleminfo(Solver *solv, Id problem)
+{
+ solver_printproblemruleinfo(solv, solver_findproblemrule(solv, problem));
+}
+
+void
+solver_printcompleteprobleminfo(Solver *solv, Id problem)
+{
+ Queue q;
+ Id probr;
+ int i, nobad = 0;
+
+ queue_init(&q);
+ solver_findallproblemrules(solv, problem, &q);
+ for (i = 0; i < q.count; i++)
+ {
+ probr = q.elements[i];
+ if (!(probr >= solv->updaterules && probr < solv->updaterules_end) && !(probr >= solv->jobrules && probr < solv->jobrules_end))
+ {
+ nobad = 1;
+ break;
+ }
+ }
+ for (i = 0; i < q.count; i++)
+ {
+ probr = q.elements[i];
+ if (nobad && ((probr >= solv->updaterules && probr < solv->updaterules_end) || (probr >= solv->jobrules && probr < solv->jobrules_end)))
+ continue;
+ solver_printproblemruleinfo(solv, probr);
+ }
+ queue_free(&q);
+}
+
+void
solver_printsolution(Solver *solv, Id problem, Id solution)
{
Pool *pool = solv->pool;
pcnt++;
POOL_DEBUG(SAT_DEBUG_RESULT, "Problem %d:\n", pcnt);
POOL_DEBUG(SAT_DEBUG_RESULT, "====================================\n");
+#if 1
solver_printprobleminfo(solv, problem);
+#else
+ solver_printcompleteprobleminfo(solv, problem);
+#endif
POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
solution = 0;
while ((solution = solver_next_solution(solv, problem, solution)) != 0)
extern void solver_printdecisions(Solver *solv);
extern void solver_printtransaction(Solver *solv);
extern void solver_printprobleminfo(Solver *solv, Id problem);
+extern void solver_printcompleteprobleminfo(Solver *solv, Id problem);
extern void solver_printsolution(Solver *solv, Id problem, Id solution);
extern void solver_printallsolutions(Solver *solv);
extern void solver_printtrivial(Solver *solv);