From: Michael Schroeder Date: Mon, 12 Nov 2012 13:22:39 +0000 (+0100) Subject: fix stupid typo in repo_deb, specialize obsoletes instead of dropping them X-Git-Tag: BASE-SuSE-Code-12_3-Branch~183 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=daad86c69b2709ffa1613e2dbea4a3c309e2c0fc;p=thirdparty%2Flibsolv.git fix stupid typo in repo_deb, specialize obsoletes instead of dropping them --- diff --git a/ext/repo_deb.c b/ext/repo_deb.c index 2e1977bf..aec35e3a 100644 --- a/ext/repo_deb.c +++ b/ext/repo_deb.c @@ -274,7 +274,7 @@ control2solvable(Solvable *s, Repodata *data, char *control) break; case 'R' << 8 | 'E': if (!strcasecmp(tag, "replaces")) - s->obsoletes = makedeps(repo, q, s->conflicts, 0); + s->obsoletes = makedeps(repo, q, s->obsoletes, 0); else if (!strcasecmp(tag, "recommends")) s->recommends = makedeps(repo, q, s->recommends, 0); break; @@ -329,22 +329,30 @@ control2solvable(Solvable *s, Repodata *data, char *control) if (s->obsoletes) { /* obsoletes only count when the packages also conflict */ + /* XXX: should not transcode here */ int i, j, k; - Id d; + Id d, cid; for (i = j = s->obsoletes; (d = repo->idarraydata[i]) != 0; i++) { - if (s->conflicts) + if (!s->conflicts) + continue; + for (k = s->conflicts; (cid = repo->idarraydata[k]) != 0; k++) { - for (k = s->conflicts; repo->idarraydata[k] != 0; k++) - if (repo->idarraydata[k] == d) - break; - if (repo->idarraydata[k]) + if (repo->idarraydata[k] == cid) + break; + if (ISRELDEP(cid)) { - repo->idarraydata[j++] = d; + Reldep *rd = GETRELDEP(pool, cid); + if (rd->flags < 8 && rd->name == d) + break; /* specialize obsoletes */ } } + if (cid) + repo->idarraydata[j++] = cid; } repo->idarraydata[j] = 0; + if (j == s->obsoletes) + s->obsoletes = 0; } }