summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2014-04-22 18:19:07 +0200
committerMichael Schroeder <mls@suse.de>2014-04-22 18:19:07 +0200
commitf78f5de33f216051d91b9ff143ace8f4579afecf (patch)
tree5d1c7587fa2a7d84649e90a2fd84e9bf93d70751 /src
parent0b76b36879f871e751b94c2bf6cdf093aca2564d (diff)
downloadlibsolv-f78f5de33f216051d91b9ff143ace8f4579afecf.tar.gz
libsolv-f78f5de33f216051d91b9ff143ace8f4579afecf.tar.bz2
libsolv-f78f5de33f216051d91b9ff143ace8f4579afecf.zip
obey droporphaned map in keep_orhans mode
Diffstat (limited to 'src')
-rw-r--r--src/rules.c4
-rw-r--r--src/solver.c29
2 files changed, 16 insertions, 17 deletions
diff --git a/src/rules.c b/src/rules.c
index 78cc1e0..264a1b7 100644
--- a/src/rules.c
+++ b/src/rules.c
@@ -1249,8 +1249,8 @@ solver_addupdaterule(Solver *solv, Solvable *s, int allow_all)
if (!allow_all && !p && solv->dupmap_all)
{
queue_push(&solv->orphaned, s - pool->solvables); /* an orphaned package */
- if (solv->keep_orphans)
- p = s - pool->solvables;
+ if (solv->keep_orphans && !(solv->droporphanedmap_all || (solv->droporphanedmap.size && MAPTST(&solv->droporphanedmap, s - pool->solvables - solv->installed->start))))
+ p = s - pool->solvables; /* keep this orphaned package installed */
}
if (!allow_all && qs.count && solv->multiversion.size)
diff --git a/src/solver.c b/src/solver.c
index 282dd78..065cb7f 100644
--- a/src/solver.c
+++ b/src/solver.c
@@ -3359,6 +3359,7 @@ solver_solve(Solver *solv, Queue *job)
if (installed)
{
/* check for update/verify jobs as they need to be known early */
+ /* also setup the droporphaned map, we need it when creating update rules */
for (i = 0; i < job->count; i += 2)
{
how = job->elements[i];
@@ -3444,6 +3445,19 @@ solver_solve(Solver *solv, Queue *job)
add_update_target(solv, p, how);
}
break;
+ case SOLVER_DROP_ORPHANED:
+ if (select == SOLVER_SOLVABLE_ALL || (select == SOLVER_SOLVABLE_REPO && what == installed->repoid))
+ solv->droporphanedmap_all = 1;
+ FOR_JOB_SELECT(p, pp, select, what)
+ {
+ s = pool->solvables + p;
+ if (s->repo != installed)
+ continue;
+ if (!solv->droporphanedmap.size)
+ map_grow(&solv->droporphanedmap, installed->end - installed->start);
+ MAPSET(&solv->droporphanedmap, p - installed->start);
+ }
+ break;
default:
break;
}
@@ -3777,17 +3791,6 @@ solver_solve(Solver *solv, Queue *job)
break;
case SOLVER_DROP_ORPHANED:
POOL_DEBUG(SOLV_DEBUG_JOB, "job: drop orphaned %s\n", solver_select2str(pool, select, what));
- if (select == SOLVER_SOLVABLE_ALL || (select == SOLVER_SOLVABLE_REPO && installed && what == installed->repoid))
- solv->droporphanedmap_all = 1;
- FOR_JOB_SELECT(p, pp, select, what)
- {
- s = pool->solvables + p;
- if (!installed || s->repo != installed)
- continue;
- if (!solv->droporphanedmap.size)
- map_grow(&solv->droporphanedmap, installed->end - installed->start);
- MAPSET(&solv->droporphanedmap, p - installed->start);
- }
break;
case SOLVER_USERINSTALLED:
POOL_DEBUG(SOLV_DEBUG_JOB, "job: user installed %s\n", solver_select2str(pool, select, what));
@@ -3797,10 +3800,6 @@ solver_solve(Solver *solv, Queue *job)
break;
}
- /*
- * debug
- */
-
IF_POOLDEBUG (SOLV_DEBUG_JOB)
{
int j;