index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Judd Vinet <judd@archlinux.org> | 2006-07-04 17:48:15 +0000 |
---|---|---|
committer | Judd Vinet <judd@archlinux.org> | 2006-07-04 17:48:15 +0000 |
commit | ef7cbbb771d8e6bbdd0fda0d3ddd4364856aa17b (patch) | |
tree | 7e950d24a16489714b3b207b10997b31c1f2baee | |
parent | 7236dd32872f0eeed21a97d15807f0ef27f45a20 (diff) |
-rw-r--r-- | lib/libalpm/deps.c | 39 |
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index 3b4ea1d9..978ffb68 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -290,11 +290,27 @@ PMList *_alpm_checkdeps(pmdb_t *db, unsigned char op, PMList *packages) } } } - /* check other targets */ - for(k = packages; k && !found; k = k->next) { - pmpkg_t *p = (pmpkg_t *)k->data; - /* see if the package names match OR if p provides depend.name */ - if(!strcmp(p->name, depend.name) || _alpm_list_is_strin(depend.name, p->provides)) { + /* check database for provides matches */ + if(!found) { + PMList *m; + k = _alpm_db_whatprovides(db, depend.name); + for(m = k; m && !found; m = m->next) { + /* look for a match that isn't one of the packages we're trying + * to install. this way, if we match against a to-be-installed + * package, we'll defer to the NEW one, not the one already + * installed. */ + pmpkg_t *p = m->data; + PMList *n; + int skip = 0; + for(n = packages; n && !skip; n = n->next) { + pmpkg_t *ptp = n->data; + if(!strcmp(ptp->name, p->name)) { + skip = 1; + } + } + if(skip) { + continue; + } if(depend.mod == PM_DEP_MOD_ANY) { /* accept any version */ found = 1; @@ -317,13 +333,13 @@ PMList *_alpm_checkdeps(pmdb_t *db, unsigned char op, PMList *packages) FREE(ver); } } + FREELISTPTR(k); } - /* check database for provides matches */ - if(!found){ - k = _alpm_db_whatprovides(db, depend.name); - if(k) { - /* grab the first one (there should only really be one, anyway) */ - pmpkg_t *p = k->data; + /* check other targets */ + for(k = packages; k && !found; k = k->next) { + pmpkg_t *p = (pmpkg_t *)k->data; + /* see if the package names match OR if p provides depend.name */ + if(!strcmp(p->name, depend.name) || _alpm_list_is_strin(depend.name, p->provides)) { if(depend.mod == PM_DEP_MOD_ANY) { /* accept any version */ found = 1; @@ -345,7 +361,6 @@ PMList *_alpm_checkdeps(pmdb_t *db, unsigned char op, PMList *packages) } FREE(ver); } - FREELISTPTR(k); } } /* else if still not found... */ |