diff options
author | Michael Schroeder <mls@suse.de> | 2008-11-17 16:11:48 +0000 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2008-11-17 16:11:48 +0000 |
commit | a02b8816645a863699feaf18c4301d539a660e4b (patch) | |
tree | d0ef9743171f76b33da988b567714ead2dcd56b6 /src/policy.c | |
parent | 52802470dfacc33a7994688cd284cb82665f102b (diff) | |
download | libsolv-a02b8816645a863699feaf18c4301d539a660e4b.tar.gz libsolv-a02b8816645a863699feaf18c4301d539a660e4b.tar.bz2 libsolv-a02b8816645a863699feaf18c4301d539a660e4b.zip |
- fix repo prio pruning in the case when first solvable is installed
Diffstat (limited to 'src/policy.c')
-rw-r--r-- | src/policy.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/policy.c b/src/policy.c index 37d2134..9e7db50 100644 --- a/src/policy.c +++ b/src/policy.c @@ -95,7 +95,7 @@ prune_to_highest_prio(Pool *pool, Queue *plist) { int i, j; Solvable *s; - int bestprio = 0; + int bestprio = 0, bestprioset = 0; /* prune to highest priority */ for (i = 0; i < plist->count; i++) /* find highest prio in queue */ @@ -103,9 +103,14 @@ prune_to_highest_prio(Pool *pool, Queue *plist) s = pool->solvables + plist->elements[i]; if (pool->installed && s->repo == pool->installed) continue; - if (i == 0 || s->repo->priority > bestprio) - bestprio = s->repo->priority; + if (!bestprioset || s->repo->priority > bestprio) + { + bestprio = s->repo->priority; + bestprioset = 1; + } } + if (!bestprioset) + return; for (i = j = 0; i < plist->count; i++) /* remove all with lower prio */ { s = pool->solvables + plist->elements[i]; |