71 if (p <= 0 || !s->repo)
84 for (i = 0; i < ti->
count; i += 2)
93 for (i = 0; i < pkgs->
count; i += 2)
100 for (i = 0; i < ti->
count; i += 2)
104 else if (pkgs->
count)
118 if (p <= 0 || !s->repo)
123 return p < 0 ? -p : p;
214 if (!strncmp(n,
"patch:", 6))
216 if (!strncmp(n,
"pattern:", 8))
266 if (s->
repo != pool->
installed && (mode & SOLVER_TRANSACTION_SHOW_ACTIVE) != 0)
311 for (i = 0; i < oq.
count; i++)
314 if ((mode & SOLVER_TRANSACTION_SHOW_OBSOLETES) == 0)
324 for (j = 0; j < rq.
count; j++)
372 return a[2] && b[2] ? strcmp(
id2str(pool, a[2]),
id2str(pool, b[2])) : r;
375 return a[3] && b[3] ? strcmp(
id2str(pool, a[3]),
id2str(pool, b[3])) : r;
407 Id v, vq, type, p, q;
411 memset(ntypes, 0,
sizeof(ntypes));
433 for (j = 0; j < classes->
count; j += 4)
436 if (j == classes->
count)
453 for (j = 0; j < classes->
count; j += 4)
456 if (j == classes->
count)
468 if (classes->
count > 4)
520 if ((!from && !to) || (s->
arch == from && sq->
arch == to))
528 if ((!from && !to) || (v == from && vq == to))
551 for (i = 0; i < decisionq->
count; i++)
557 if (!s->
repo || s->
repo == installed)
565 if (s2->
repo != installed)
579 while ((obs = *obsp++) != 0)
584 if (s2->
repo != installed)
598 for (i = j = 0; i < ti->
count; i += 2)
609 for (i = 0; i < ti->
count; i += 2)
639 if (noobsmap && !noobsmap->
size)
644 for (i = 0; i < decisionq->
count; i++)
650 if (installed && s->
repo == installed && p < 0)
652 if ((!installed || s->
repo != installed) && p > 0)
656 if (!strncmp(n,
"patch:", 6))
658 if (!strncmp(n,
"pattern:", 8))
662 if (noobsmap &&
MAPTST(noobsmap, p))
680 for (i = 0; i < decisionq->
count; i++)
703 if (installed && s->
repo == installed)
707 cutoff = installedq->
count;
731 if (!installed || s->
repo != installed)
777 #define TYPE_BROKEN (1<<0)
778 #define TYPE_CON (1<<1)
780 #define TYPE_REQ_P (1<<2)
781 #define TYPE_PREREQ_P (1<<3)
783 #define TYPE_REQ (1<<4)
784 #define TYPE_PREREQ (1<<5)
786 #define TYPE_CYCLETAIL (1<<16)
787 #define TYPE_CYCLEHEAD (1<<17)
789 #define EDGEDATA_BLOCK 127
794 memset(trans, 0,
sizeof(*trans));
801 memset(trans, 0,
sizeof(*trans));
932 for (i = 0; i < ti.
count; i++)
952 for (i = 0; i < ti.
count; i++)
960 for (i = 1, te = od->
tes + i; i < od->ntes; i++, te++)
967 for (i = 1, te = od->
tes + i; i < od->ntes; i++, te++)
982 Id ti1buf[5], ti2buf[5];
989 printf(
"havechoice %d %d %d\n", p, q1, q2);
1003 for (i = 0; i < ti1.
count; i++)
1004 for (j = 0; j < ti2.
count; j++)
1028 while ((req = *reqp++) != 0)
1030 if (req == SOLVABLE_PREREQMARKER)
1038 if (*dep ==
'/' && strcmp(dep,
"/sbin/ldconfig") != 0)
1050 Id req, *reqp, con, *conp;
1052 int i, j, pre, numins;
1059 printf(
"addsolvableedges %s\n",
solvable2str(pool, s));
1067 while ((req = *reqp++) != 0)
1069 if (req == SOLVABLE_PREREQMARKER)
1107 if (s->
repo == installed)
1111 if (s2->
repo != installed)
1116 if (s2->
repo == installed)
1124 for (i = j = 0; i < reqq.
count; i++)
1130 if (numins && reqq.
count)
1132 if (s->
repo == installed)
1134 for (i = 0; i < reqq.
count; i++)
1138 for (j = 0; j < reqq.
count; j++)
1154 for (i = j = 0; i < reqq.
count; i++)
1161 for (i = 0; i < reqq.
count; i++)
1168 choice = reqq.
count - 1;
1172 printf(
"add inst->inst edge choice %d (%s -> %s -> %s)\n", choice,
solvid2str(pool, p),
dep2str(pool, req),
solvid2str(pool, p2));
1179 printf(
"add uninst->inst edge choice %d (%s -> %s -> %s)\n", choice,
solvid2str(pool, p),
dep2str(pool, req),
solvid2str(pool, p2));
1186 if (s->
repo != installed)
1198 for (j = 0; j < reqq.
count; j++)
1207 printf(
"add uninst->uninst edge choice %d (%s -> %s -> %s)\n", choice,
solvid2str(pool, p),
dep2str(pool, req),
solvid2str(pool, p2));
1217 while ((con = *conp++) != 0)
1226 if (s->
repo == installed)
1256 for (i = 0; i < reqq.
count; i++)
1288 Id ddegmin, ddegmax, ddeg;
1293 ddegmin = ddegmax = 0;
1294 for (k = 0; cycle[k + 1]; k += 2)
1296 ddeg = od->
edgedata[cycle[k + 1] + 1];
1299 if (!k || ddeg < ddegmin)
1305 if (ddeg == ddegmin)
1346 for (k = 0; cycle[k + 1]; k += 2)
1348 te = od->
tes + cycle[k];
1366 for (i = 1, te = od->
tes + i; i < od->ntes; i++, te++)
1374 for (j = 0; j < obsq.
count; j++)
1428 printf(
"addcycleedges\n");
1429 for (i = 0; (j = cycle[i]) != 0; i++)
1437 for (i = 1, te = od->
tes + i; i < od->ntes; i++, te++)
1439 for (i = 0; (j = cycle[i]) != 0; i++)
1465 for (i = 1, te = od->
tes + i; i < od->ntes; i++, te++)
1491 for (i = 1, te = od->
tes + i; i < od->ntes; i++, te++)
1494 for (i = 0; (j = cycle[i]) != 0; i++)
1500 te = od->
tes + head;
1510 for (i = 0; cycle[i] != 0; i++)
1512 if (cycle[i] == head)
1514 te = od->
tes + cycle[i];
1543 int i, j, k, numte, numedge;
1546 Queue todo, obsq, samerepoq, uninstq;
1547 int cycstart, cycel;
1568 for (i = 0; i < tr->
count; i++)
1581 memset(&od, 0,
sizeof(od));
1591 for (i = 0, te = od.
tes + 1; i < tr->count; i++)
1602 for (i = 0; i < tr->
count; i++)
1607 for (i = 1, te = od.
tes + i; i < numte; i++, te++)
1620 for (i = numte - 1; i > 0; i--)
1638 int edgestovisit = 0;
1646 if (!edgestovisit++)
1658 for (j = todo.
count - 1; j >= 0; j--)
1665 for (j = k; j < todo.
count; j++)
1668 cycel = k - cycstart;
1671 while (todo.
count < cycstart + 2 * cycel + 2)
1675 cycle[2 * cycel + 1] = 0;
1676 for (k = cycel; k > 0; k--)
1678 cycle[k * 2] = cycle[k];
1679 te = od.
tes + cycle[k - 1];
1680 assert(te->
mark == 1);
1687 cycle[k * 2 - 1] = j;
1693 todo.
count = cycstart + 1;
1720 for (i = 1, te = od.
tes + i; i < numte; i++, te++)
1722 for (i = 1, te = od.
tes + i; i < numte; i++, te++)
1732 for (i = 1, te = od.
tes + i; i < numte; i++, te++)
1739 for (i = 1, te = od.
tes + i; i < numte; i++, te++)
1748 for (i = 1, te = od.
tes + i; i < numte; i++, te++)
1754 for (i = 1, te = od.
tes + i; i < numte; i++, te++)
1756 for (i = 1, te = od.
tes + i; i < numte; i++, te++)
1763 for (i = 1, te = od.
tes + i; i < numte; i++, te++)
1772 oldcount = tr->
count;
1780 for (i = 1; i < numte; i++)
1783 if (installed && s->
repo == installed)
1794 else if (samerepoq.
count)
1796 else if (todo.
count)
1799 for (j = 0; j < todo.
count; j++)
1801 if (!j || temedianr[todo.
elements[j]] < lastmedia)
1804 lastmedia = temedianr[todo.
elements[j]];
1810 for (i = j = 0; j < todo.
count; j++)
1820 assert(samerepoq.
count);
1829 printf(
"do %s [%d]\n",
solvid2str(pool, te->
p), temedianr[i]);
1835 assert(te2->
mark > 0);
1836 if (--te2->
mark == 0)
1842 if (installed && s->
repo == installed)
1844 else if (s->
repo == lastrepo && temedianr[od.
invedgedata[j]] == lastmedia)
1856 for (i = 1, te = od.
tes + i; i < numte; i++, te++)
1857 assert(te->
mark == 0);
1861 assert(tr->
count == oldcount);
1890 return choices->
count;
1894 for (i = 1, te = od->
tes + i; i < od->ntes; i++, te++)
1896 for (i = 1, te = od->
tes + i; i < od->ntes; i++, te++)
1901 for (i = 1, te = od->
tes + i; i < od->ntes; i++, te++)
1904 return choices->
count;
1906 for (i = 1, te = od->
tes + i; i < od->ntes; i++, te++)
1907 if (te->
p == chosen)
1910 return choices->
count;
1919 assert(te->
mark > 0 || te->
mark == -1);
1920 if (te->
mark > 0 && --te->
mark == 0)
1923 return choices->
count;
1947 steps = &trans->
steps;
1953 for (j = 0, i = max; i < steps->
count; i++)
1965 for (k = 0; k < obsq.
count; k++)
1968 assert(p >= installed->
start && p < installed->end);
2002 while ((req = *reqp++) != 0)
2004 if (req == SOLVABLE_PREREQMARKER)
2009 if (onlyprereq && !inpre)
2011 if (!strncmp(
id2str(pool, req),
"rpmlib(", 7))