From fa627d4776ae56197f2aead259c8b5e19d269586 Mon Sep 17 00:00:00 2001 From: Judd Vinet Date: Fri, 21 Oct 2005 19:55:24 +0000 Subject: bugfix: before searching databases for a dependency, make sure one of the packages in the final list doesn't already provide that dependency --- lib/libalpm/deps.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'lib/libalpm') 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) { -- cgit v1.2.3-24-g4f1b