From: Michael Schroeder Date: Tue, 8 Jul 2014 12:09:48 +0000 (+0200) Subject: fix instbuddy generation code X-Git-Tag: 0.6.4~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c50b68298dd430a3cdf58a0c252a890fcdc23dd2;p=thirdparty%2Flibsolv.git fix instbuddy generation code we iterated over the wrong array, thus the rpm -> buddy link did not work. --- diff --git a/src/rules.c b/src/rules.c index 264a1b77..6b561cc1 100644 --- a/src/rules.c +++ b/src/rules.c @@ -496,9 +496,9 @@ addlinks(Solver *solv, Solvable *s, Id req, Queue *qr, Id prv, Queue *qp, Map *m solv->instbuddy = solv_calloc(installed->end - installed->start, sizeof(Id)); if (qr->count == 1) solv->instbuddy[s - pool->solvables - installed->start] = qr->elements[0]; - for (i = 0; i < qp->count; i++) + for (i = 0; i < qr->count; i++) { - Id p = qp->elements[i]; + Id p = qr->elements[i]; if (pool->solvables[p].repo != installed) continue; /* huh? */ if (qp->count > 1 || (solv->instbuddy[p - installed->start] != 0 && solv->instbuddy[p - installed->start] != s - pool->solvables))