summaryrefslogtreecommitdiff
path: root/src/policy.c
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2014-06-24 13:40:02 +0200
committerMichael Schroeder <mls@suse.de>2014-06-24 13:40:02 +0200
commit04b192f26d73bd4394451b2b9faacad3c11d5163 (patch)
tree98a5d04436bdcaf0d7212b8fc8a64e844bcb9ba7 /src/policy.c
parenta52836206e91b14de83ffa1f9cce7194066f314f (diff)
downloadlibsolv-04b192f26d73bd4394451b2b9faacad3c11d5163.tar.gz
libsolv-04b192f26d73bd4394451b2b9faacad3c11d5163.tar.bz2
libsolv-04b192f26d73bd4394451b2b9faacad3c11d5163.zip
rework branch handling so that the old decisions are still available
This allows us to auto-minimize packages that got supplemented later on.
Diffstat (limited to 'src/policy.c')
-rw-r--r--src/policy.c56
1 files changed, 34 insertions, 22 deletions
diff --git a/src/policy.c b/src/policy.c
index cf05de0..5b72517 100644
--- a/src/policy.c
+++ b/src/policy.c
@@ -331,34 +331,14 @@ recheck_complex_dep(Solver *solv, Id p, Map *m, Queue **cqp)
#endif
-/*
- * prune to recommended/suggested packages.
- * does not prune installed packages (they are also somewhat recommended).
- */
-static void
-prune_to_recommended(Solver *solv, Queue *plist)
+void
+policy_update_recommendsmap(Solver *solv)
{
Pool *pool = solv->pool;
- int i, j, k, ninst;
Solvable *s;
Id p, pp, rec, *recp, sug, *sugp;
- ninst = 0;
- if (pool->installed)
- {
- for (i = 0; i < plist->count; i++)
- {
- p = plist->elements[i];
- s = pool->solvables + p;
- if (pool->installed && s->repo == pool->installed)
- ninst++;
- }
- }
- if (plist->count - ninst < 2)
- return;
-
- /* update our recommendsmap/suggestsmap */
if (solv->recommends_index < 0)
{
MAPZERO(&solv->recommendsmap);
@@ -424,6 +404,38 @@ prune_to_recommended(Solver *solv, Queue *plist)
}
}
}
+}
+
+/*
+ * prune to recommended/suggested packages.
+ * does not prune installed packages (they are also somewhat recommended).
+ */
+
+static void
+prune_to_recommended(Solver *solv, Queue *plist)
+{
+ Pool *pool = solv->pool;
+ int i, j, k, ninst;
+ Solvable *s;
+ Id p;
+
+ ninst = 0;
+ if (pool->installed)
+ {
+ for (i = 0; i < plist->count; i++)
+ {
+ p = plist->elements[i];
+ s = pool->solvables + p;
+ if (pool->installed && s->repo == pool->installed)
+ ninst++;
+ }
+ }
+ if (plist->count - ninst < 2)
+ return;
+
+ /* update our recommendsmap/suggestsmap */
+ if (solv->recommends_index < solv->decisionq.count)
+ policy_update_recommendsmap(solv);
/* prune to recommended/supplemented */
ninst = 0;