return newsplit;
}
+#ifdef CPLXDEBUG
+static void
+print_depblocks(Pool *pool, Queue *bq, int start)
+{
+ int i;
+
+ for (i = start; i < bq->count; i++)
+ {
+ if (bq->elements[i] == pool->nsolvables)
+ {
+ Id *dp = pool->whatprovidesdata + bq->elements[++i];
+ printf(" (");
+ while (*dp)
+ printf(" %s", pool_solvid2str(pool, *dp++));
+ printf(" )");
+ }
+ else if (bq->elements[i] > 0)
+ printf(" %s", pool_solvid2str(pool, bq->elements[i]));
+ else if (bq->elements[i] < 0)
+ printf(" -%s", pool_solvid2str(pool, -bq->elements[i]));
+ else
+ printf(" ||");
+ }
+ printf("\n");
+}
+#endif
+
/* invert all literals in the blocks. note that this also turns DNF into CNF and vice versa */
static void
invert_depblocks(Pool *pool, Queue *bq, int start)
bq->elements[i] = -bq->elements[i];
continue;
}
- /* end of block reached, reorder */
+ /* end of block reached, reverse */
if (i - 1 > j)
{
int k;
/* get blocks of second argument */
bqcnt2 = bq->count;
- /* COND is OR with NEG on evr block, so we invert the todnf flag in that case*/
+ /* COND is OR with NEG on evr block, so we invert the todnf flag in that case */
r = normalize_dep(pool, rd->evr, bq, flags == REL_COND ? todnf ^ 1 : todnf);
if (r == 0)
{
else if (i == 1)
printf("ALL\n");
else
- {
- for (i = bqcnt; i < bq->count; i++)
- {
- if (bq->elements[i] == pool->nsolvables)
- {
- Id *dp = pool->whatprovidesdata + bq->elements[++i];
- printf(" (");
- while (*dp)
- printf(" %s", pool_solvid2str(pool, *dp++));
- printf(" )");
- }
- else if (bq->elements[i] > 0)
- printf(" %s", pool_solvid2str(pool, bq->elements[i]));
- else if (bq->elements[i] < 0)
- printf(" -%s", pool_solvid2str(pool, -bq->elements[i]));
- else
- printf(" ||");
- }
- printf("\n");
- i = -1;
- }
+ print_depblocks(pool, bq, bqcnt);
#endif
return i;
}
#ifdef ENABLE_COMPLEX_DEPS
+static inline Id
+pool_idstowhatprovides(Pool *pool, int count, Id *elements)
+{
+ /* hack: create fake queue 'q' so that we can call pool_queuetowhatprovides */
+ Queue q;
+ memset(&q, 0, sizeof(q));
+ q.count = count;
+ q.elements = elements;
+ return pool_queuetowhatprovides(pool, &q);
+}
+
static void
add_complex_deprules(Solver *solv, Id p, Id dep, int type, int dontfix, Queue *workq, Map *m)
{
break;
if (j == qcnt)
{
- /* hack: create fake queue 'q' so that we can call pool_queuetowhatprovides */
- Queue q;
- memset(&q, 0, sizeof(q));
- q.count = qcnt - 1;
- q.elements = qele + 1;
- addpkgrule(solv, qele[0], pool_queuetowhatprovides(pool, &q), type, dep);
+ addpkgrule(solv, qele[0], pool_idstowhatprovides(pool, qcnt - 1, qele + 1), type, dep);
if (m)
for (j = 0; j < qcnt; j++)
if (qele[j] > 0 && !MAPTST(m, qele[j]))