diff options
author | Judd Vinet <judd@archlinux.org> | 2005-10-21 19:55:24 +0000 |
---|---|---|
committer | Judd Vinet <judd@archlinux.org> | 2005-10-21 19:55:24 +0000 |
commit | fa627d4776ae56197f2aead259c8b5e19d269586 (patch) | |
tree | d5c96356f00f1e8da0ed74d321a40740d3e2c31c /lib/libalpm/deps.c | |
parent | cebc7ace60a8f6a03e28282cfa43fc20088693c5 (diff) | |
download | pacman-fa627d4776ae56197f2aead259c8b5e19d269586.tar.xz |
bugfix: before searching databases for a dependency, make sure one of the packages in the final list doesn't already provide that dependency
Diffstat (limited to 'lib/libalpm/deps.c')
-rw-r--r-- | lib/libalpm/deps.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index b92d2a45..e794ae52 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -545,7 +545,7 @@ PMList* removedeps(pmdb_t *db, PMList *targs) */ int resolvedeps(pmdb_t *local, PMList *dbs_sync, pmpkg_t *syncpkg, PMList *list, PMList *trail, pmtrans_t *trans) { - PMList *i, *j; + PMList *i, *j, *k; PMList *targ; PMList *deps = NULL; @@ -574,6 +574,22 @@ int resolvedeps(pmdb_t *local, PMList *dbs_sync, pmpkg_t *syncpkg, PMList *list, if(miss->type == PM_DEP_TYPE_DEPEND) { pmpkg_t *sync = NULL; + int provisio_match = 0; + + /* check if one of the packages in *list already provides this dependency */ + for(j = list; j; j = j->next) { + pmpkg_t *sp = (pmpkg_t*)j->data; + for(k = sp->provides; k; k = k->next) { + if(!strcmp(miss->depend.name, k->data)) { + _alpm_log(PM_LOG_DEBUG, "%s provides dependency %s", sp->name, miss->depend.name); + provisio_match = 1; + } + } + } + if(provisio_match) { + continue; + } + /* find the package in one of the repositories */ /* check literals */ for(j = dbs_sync; !sync && j; j = j->next) { |