diff options
author | Michael Schroeder <mls@suse.de> | 2014-03-05 13:02:54 +0100 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2014-03-05 13:02:54 +0100 |
commit | 4ce1ba32e3ce41fd9c91d60dc76895b661bba88c (patch) | |
tree | db6f32d16743557fe59382f4db89a61a1302f4a5 | |
parent | e682391a53f6876d76ef9252fd90033a0a5d227c (diff) | |
download | libsolv-4ce1ba32e3ce41fd9c91d60dc76895b661bba88c.tar.gz libsolv-4ce1ba32e3ce41fd9c91d60dc76895b661bba88c.tar.bz2 libsolv-4ce1ba32e3ce41fd9c91d60dc76895b661bba88c.zip |
also look at the pkgname when searching for the application link
-rw-r--r-- | src/linkedpkg.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/linkedpkg.c b/src/linkedpkg.c index 91bf42d..c5adc9a 100644 --- a/src/linkedpkg.c +++ b/src/linkedpkg.c @@ -47,18 +47,23 @@ find_application_link(Pool *pool, Solvable *s, Id *reqidp, Queue *qr, Id *prvidp Id req = 0; Id prv = 0; Id p, pp; + Id pkgname = 0; /* find appdata requires */ if (s->requires) { + Id appdataid = 0; Id *reqp = s->repo->idarraydata + s->requires; while ((req = *reqp++) != 0) /* go through all requires */ { if (ISRELDEP(req)) continue; if (!strncmp("appdata(", pool_id2str(pool, req), 8)) - break; + appdataid = req; + else + pkgname = req; } + req = appdataid; } if (!req) return; @@ -77,11 +82,19 @@ find_application_link(Pool *pool, Solvable *s, Id *reqidp, Queue *qr, Id *prvidp } } if (!prv) - return; + return; /* huh, no provides found? */ /* now link em */ FOR_PROVIDES(p, pp, req) if (pool->solvables[p].repo == s->repo) - queue_push(qr, p); + if (!pkgname || pool->solvables[p].name == pkgname) + queue_push(qr, p); + if (!qr->count && pkgname) + { + /* huh, no matching package? try without pkgname filter */ + FOR_PROVIDES(p, pp, req) + if (pool->solvables[p].repo == s->repo) + queue_push(qr, p); + } if (qp) { FOR_PROVIDES(p, pp, prv) |