From: Michael Schroeder Date: Thu, 8 Feb 2018 15:46:05 +0000 (+0100) Subject: fileconflicts: make sure at least one candidate is a new install X-Git-Tag: 0.6.32~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75c833caa57c41110e55aa0de86db80b9a232ef0;p=thirdparty%2Flibsolv.git fileconflicts: make sure at least one candidate is a new install No need to get only installed packages. --- diff --git a/ext/pool_fileconflicts.c b/ext/pool_fileconflicts.c index cb55d58a..8efb9dea 100644 --- a/ext/pool_fileconflicts.c +++ b/ext/pool_fileconflicts.c @@ -985,7 +985,7 @@ pool_findfileconflicts(Pool *pool, Queue *pkgs, int cutoff, Queue *conflicts, in solv_sort(cbdata.lookat.elements, cbdata.lookat.count / 4, sizeof(Id) * 4, &lookat_hx_cmp, pool); for (i = j = 0; i < cbdata.lookat.count; ) { - int first = 1; + int first = 1, jstart = j; Id hx = cbdata.lookat.elements[i]; Id idx = cbdata.lookat.elements[i + 1]; Id dhx = cbdata.lookat.elements[i + 2]; @@ -1004,6 +1004,8 @@ pool_findfileconflicts(Pool *pool, Queue *pkgs, int cutoff, Queue *conflicts, in cbdata.lookat.elements[j++] = dhx; cbdata.lookat.elements[j++] = dirid; first = 0; + if (jstart >= 0 && idx < cutoff) + jstart = -1; } idx = cbdata.lookat.elements[i + 1]; dhx = cbdata.lookat.elements[i + 2]; @@ -1011,7 +1013,11 @@ pool_findfileconflicts(Pool *pool, Queue *pkgs, int cutoff, Queue *conflicts, in cbdata.lookat.elements[j++] = idx; cbdata.lookat.elements[j++] = dhx; cbdata.lookat.elements[j++] = dirid; + if (jstart >= 0 && idx < cutoff) + jstart = -1; } + if (jstart >= 0) /* we need at least one new candidate */ + j = jstart; } queue_truncate(&cbdata.lookat, j); POOL_DEBUG(SOLV_DEBUG_STATS, "candidates now: %d\n", cbdata.lookat.count / 4);