summaryrefslogtreecommitdiff
path: root/src/rules.c
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2020-11-27 14:49:28 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2020-11-27 14:49:28 +0900
commit2792a56227313bb9f16bd70604e79f47e9650885 (patch)
tree85754605f94cb80db83190caa787a8fbff433daa /src/rules.c
parente0e41666c5a48c53ab30c943f2b0964a3600eadd (diff)
downloadlibsolv-2792a56227313bb9f16bd70604e79f47e9650885.tar.gz
libsolv-2792a56227313bb9f16bd70604e79f47e9650885.tar.bz2
libsolv-2792a56227313bb9f16bd70604e79f47e9650885.zip
Imported Upstream version 0.7.14upstream/0.7.14
Diffstat (limited to 'src/rules.c')
-rw-r--r--src/rules.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/rules.c b/src/rules.c
index 6b1432f..ffa2988 100644
--- a/src/rules.c
+++ b/src/rules.c
@@ -3210,7 +3210,7 @@ solver_addchoicerules(Solver *solv)
Map m, mneg;
Rule *r;
Queue q, qi, qcheck, infoq;
- int i, j, rid, havechoice;
+ int i, j, rid, havechoice, negcnt;
Id p, d, pp;
Id p2, pp2;
Solvable *s, *s2;
@@ -3389,9 +3389,12 @@ solver_addchoicerules(Solver *solv)
qi.elements[j] = 0;
}
/* empty map again */
+ negcnt = 0;
FOR_RULELITERALS(p, pp, r)
if (p > 0)
MAPCLR(&m, p);
+ else
+ negcnt++;
if (i == qi.count)
{
#if 0
@@ -3400,7 +3403,14 @@ solver_addchoicerules(Solver *solv)
#endif
continue;
}
-
+ /* add neg elements to the front */
+ if (negcnt > 1)
+ {
+ i = 0;
+ FOR_RULELITERALS(p, pp, r)
+ if (p < 0 && p != r->p)
+ queue_insert(&q, i++, p);
+ }
/* don't add identical rules */
if (lastaddedp == r->p && lastaddedcnt == q.count)
{