summaryrefslogtreecommitdiff
path: root/src/policy.c
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2019-09-10 15:37:46 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2019-09-10 15:37:46 +0900
commit0e46e80434781d1acbc4f5716827bf8688450a30 (patch)
treebd75ab938e88eb1e111c3bcb099d7a6793bd4364 /src/policy.c
parente679b515eddb3dd340fb25620de0160211f40fdc (diff)
downloadlibsolv-0e46e80434781d1acbc4f5716827bf8688450a30.tar.gz
libsolv-0e46e80434781d1acbc4f5716827bf8688450a30.tar.bz2
libsolv-0e46e80434781d1acbc4f5716827bf8688450a30.zip
Imported Upstream version 0.6.36upstream/0.6.36
Diffstat (limited to 'src/policy.c')
-rw-r--r--src/policy.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/policy.c b/src/policy.c
index a38dea0..e1682f2 100644
--- a/src/policy.c
+++ b/src/policy.c
@@ -866,6 +866,8 @@ move_installed_to_front(Pool *pool, Queue *plist)
Solvable *s;
Id p, pp;
+ if (!pool->installed)
+ return;
for (i = j = 0; i < plist->count; i++)
{
s = pool->solvables + plist->elements[i];
@@ -924,9 +926,9 @@ prune_to_best_version(Pool *pool, Queue *plist)
{
s = pool->solvables + plist->elements[i];
- POOL_DEBUG(SOLV_DEBUG_POLICY, "- %s[%s]\n",
- pool_solvable2str(pool, s),
- (pool->installed && s->repo == pool->installed) ? "installed" : "not installed");
+ POOL_DEBUG(SOLV_DEBUG_POLICY, "- %s [%d]%s\n",
+ pool_solvable2str(pool, s), plist->elements[i],
+ (pool->installed && s->repo == pool->installed) ? "I" : "");
if (!best) /* if no best yet, the current is best */
{
@@ -961,8 +963,6 @@ prune_to_best_version(Pool *pool, Queue *plist)
else
prune_obsoleted(pool, plist);
}
- if (plist->count > 1 && pool->installed)
- move_installed_to_front(pool, plist);
}
@@ -1236,7 +1236,7 @@ urpm_reorder(Solver *solv, Queue *plist)
{
char kn[256];
Id p, pp, knid;
- memcpy(kn, "kernel", 8);
+ memcpy(kn, "kernel", 7);
memcpy(kn + 6, flavor, release - flavor + 1);
memcpy(kn + 6 + (release - flavor) + 1, sn, flavor - sn);
strcpy(kn + 6 + (release + 1 - sn), release);
@@ -1343,6 +1343,7 @@ policy_filter_unwanted(Solver *solv, Queue *plist, int mode)
#endif
dislike_old_versions(pool, plist);
sort_by_common_dep(pool, plist);
+ move_installed_to_front(pool, plist);
if (solv->urpmreorder)
urpm_reorder(solv, plist);
prefer_suggested(solv, plist);
@@ -1364,6 +1365,7 @@ pool_best_solvables(Pool *pool, Queue *plist, int flags)
{
dislike_old_versions(pool, plist);
sort_by_common_dep(pool, plist);
+ move_installed_to_front(pool, plist);
}
}