From: Michael Schroeder Date: Tue, 3 May 2016 15:39:05 +0000 (+0200) Subject: Also call prefer_favored at the end of reorder_dq_for_jobrules X-Git-Tag: 0.6.21~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fcdcf97e4591588bff1c8aa0ff7dfd79f1a9565;p=thirdparty%2Flibsolv.git Also call prefer_favored at the end of reorder_dq_for_jobrules Otherwise we may select the wrong package. --- diff --git a/src/policy.c b/src/policy.c index 528c8c98..8b8412dd 100644 --- a/src/policy.c +++ b/src/policy.c @@ -498,8 +498,8 @@ sort_by_favorq(Queue *favorq, Id *el, int cnt) } /* bring favored packages to front and disfavored packages to back */ -static void -prefer_favored(Solver *solv, Queue *plist) +void +policy_prefer_favored(Solver *solv, Queue *plist) { int i, fav, disfav, count; if (!solv->favormap.size) @@ -1210,7 +1210,7 @@ policy_filter_unwanted(Solver *solv, Queue *plist, int mode) dislike_old_versions(pool, plist); sort_by_common_dep(pool, plist); prefer_suggested(solv, plist); - prefer_favored(solv, plist); + policy_prefer_favored(solv, plist); return; } if (plist->count > 1) @@ -1236,7 +1236,7 @@ policy_filter_unwanted(Solver *solv, Queue *plist, int mode) dislike_old_versions(pool, plist); sort_by_common_dep(pool, plist); prefer_suggested(solv, plist); - prefer_favored(solv, plist); + policy_prefer_favored(solv, plist); } } } diff --git a/src/policy.h b/src/policy.h index 8f875c79..0c3c7cb0 100644 --- a/src/policy.h +++ b/src/policy.h @@ -40,6 +40,7 @@ extern void policy_create_obsolete_index(Solver *solv); /* internal, do not use */ extern void prune_to_best_version(Pool *pool, Queue *plist); +extern void policy_prefer_favored(Solver *solv, Queue *plist); #ifdef __cplusplus diff --git a/src/solver.c b/src/solver.c index cd9df6f2..dc42dcdc 100644 --- a/src/solver.c +++ b/src/solver.c @@ -1432,6 +1432,8 @@ reorder_dq_for_jobrules(Solver *solv, int level, Queue *dq) solv->recommends_index = -1; queue_truncate(&solv->decisionq, decisionqcount); } + /* but obey favored maps */ + policy_prefer_favored(solv, dq); } /*-------------------------------------------------------------------