bugfix: before searching databases for a dependency, make sure one of the packages in the final list doesn't already provide that dependency

This commit is contained in:
Judd Vinet 2005-10-21 19:55:24 +00:00
parent cebc7ace60
commit fa627d4776

View file

@ -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) 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 *targ;
PMList *deps = NULL; 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) { if(miss->type == PM_DEP_TYPE_DEPEND) {
pmpkg_t *sync = NULL; 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 */ /* find the package in one of the repositories */
/* check literals */ /* check literals */
for(j = dbs_sync; !sync && j; j = j->next) { for(j = dbs_sync; !sync && j; j = j->next) {