}
}
+static inline int
+is_pseudo_package(Pool *pool, Solvable *s)
+{
+ const char *n = pool_id2str(pool, s->name);
+ if (!strncmp(n, "patch:", 6))
+ return 1;
+ if (!strncmp(n, "pattern:", 8))
+ return 1;
+ return 0;
+}
+
+static int
+obsoleted_by_pseudos_only(Transaction *trans, Id p)
+{
+ Pool *pool = trans->pool;
+ Queue q;
+ Id op;
+ int i;
+
+ op = transaction_obs_pkg(trans, p);
+ if (op && !is_pseudo_package(pool, pool->solvables + op))
+ return 0;
+ queue_init(&q);
+ transaction_all_obs_pkgs(trans, p, &q);
+ for (i = 0; i < q.count; i++)
+ if (!is_pseudo_package(pool, pool->solvables + q.elements[i]))
+ break;
+ i = !q.count || i < q.count ? 0 : 1;
+ queue_free(&q);
+ return i;
+}
+
/*
* return type of transaction element
*
return SOLVER_TRANSACTION_IGNORE;
/* XXX: SUSE only? */
- if (!(mode & SOLVER_TRANSACTION_KEEP_PSEUDO))
- {
- const char *n = pool_id2str(pool, s->name);
- if (!strncmp(n, "patch:", 6))
- return SOLVER_TRANSACTION_IGNORE;
- if (!strncmp(n, "pattern:", 8))
- return SOLVER_TRANSACTION_IGNORE;
- }
+ if (!(mode & SOLVER_TRANSACTION_KEEP_PSEUDO) && is_pseudo_package(pool, s))
+ return SOLVER_TRANSACTION_IGNORE;
type = transaction_base_type(trans, p);
if (type == SOLVER_TRANSACTION_ERASE || type == SOLVER_TRANSACTION_INSTALL || type == SOLVER_TRANSACTION_MULTIINSTALL)
return type;
if (s->repo == pool->installed)
- return SOLVER_TRANSACTION_IGNORE; /* ignore as we're being obsoleted */
+ {
+ /* check if we're obsoleted by pseudos only */
+ if (obsoleted_by_pseudos_only(trans, s - pool->solvables))
+ return SOLVER_TRANSACTION_ERASE;
+ return SOLVER_TRANSACTION_IGNORE; /* ignore as we're being obsoleted */
+ }
if (type == SOLVER_TRANSACTION_MULTIREINSTALL)
return SOLVER_TRANSACTION_MULTIINSTALL;
return SOLVER_TRANSACTION_INSTALL;
continue;
if (!pool->implicitobsoleteusesprovides && s->name != s2->name)
continue;
- if (pool->obsoleteusescolors && !pool_colormatch(pool, s, s2))
+ if (pool->implicitobsoleteusescolors && !pool_colormatch(pool, s, s2))
continue;
queue_push2(ti, p, p2);
}
Map ins, seen;
int i;
- POOL_DEBUG(SOLV_WARN, "\nchecking transaction order...\n");
+ POOL_DEBUG(SOLV_DEBUG_RESULT, "\nchecking transaction order...\n");
map_init(&ins, pool->nsolvables);
map_init(&seen, pool->nsolvables);
if (pool->installed)
}
map_free(&seen);
map_free(&ins);
- POOL_DEBUG(SOLV_WARN, "transaction order check done.\n");
+ POOL_DEBUG(SOLV_DEBUG_RESULT, "transaction order check done.\n");
}