summaryrefslogtreecommitdiff
path: root/src/solver.c
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2020-11-27 14:44:14 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2020-11-27 14:44:14 +0900
commitf2f190a043324e9ab4fefab6e16577a9a103f5a9 (patch)
tree85a43ade0bd8f232f383cd1ea3b44cd840db28e5 /src/solver.c
parent308ed24db702bd76267a5e347fe83144294ed4e0 (diff)
downloadlibsolv-f2f190a043324e9ab4fefab6e16577a9a103f5a9.tar.gz
libsolv-f2f190a043324e9ab4fefab6e16577a9a103f5a9.tar.bz2
libsolv-f2f190a043324e9ab4fefab6e16577a9a103f5a9.zip
Imported Upstream version 0.7.7upstream/0.7.7
Diffstat (limited to 'src/solver.c')
-rw-r--r--src/solver.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/solver.c b/src/solver.c
index 5453b39..45f9dbf 100644
--- a/src/solver.c
+++ b/src/solver.c
@@ -1910,6 +1910,8 @@ resolve_dependencies(Solver *solv, int level, int disablerules, Queue *dq)
Rule *r;
int origlevel = level;
Id p, *dp;
+ int focusbest = solv->focus_best && solv->do_extra_reordering;
+ Repo *installed = solv->installed;
/*
* decide
@@ -1928,7 +1930,7 @@ resolve_dependencies(Solver *solv, int level, int disablerules, Queue *dq)
}
if (i == solv->nrules)
i = 1;
- if (solv->focus_best && solv->do_extra_reordering && i >= solv->featurerules)
+ if (focusbest && i >= solv->featurerules)
continue;
r = solv->rules + i;
if (r->d < 0) /* ignore disabled rules */
@@ -1938,6 +1940,19 @@ resolve_dependencies(Solver *solv, int level, int disablerules, Queue *dq)
if (r->d == 0 || solv->decisionmap[-r->p] <= 0)
continue;
}
+ if (focusbest && r->d != 0 && installed)
+ {
+ /* make sure at least one negative literal is from a new package */
+ if (!(r->p < 0 && pool->solvables[-r->p].repo != installed))
+ {
+ dp = pool->whatprovidesdata + r->d;
+ while ((p = *dp++) != 0)
+ if (p < 0 && solv->decisionmap[-p] > 0 && pool->solvables[-p].repo != installed)
+ break;
+ if (!p)
+ continue; /* sorry */
+ }
+ }
if (dq->count)
queue_empty(dq);
if (r->d == 0)