diff options
author | Aaron Griffin <aaron@archlinux.org> | 2006-10-21 20:16:55 +0000 |
---|---|---|
committer | Aaron Griffin <aaron@archlinux.org> | 2006-10-21 20:16:55 +0000 |
commit | 93311212bddb7d7e75ea91f04604ca42e85ef823 (patch) | |
tree | 9c754fe464adcb840c090db27dba01f4615393ba /lib/libalpm/deps.c | |
parent | df0dac10e5bbace9ceeeffce19d8a16e5bc3ae21 (diff) | |
download | pacman-93311212bddb7d7e75ea91f04604ca42e85ef823.tar.xz |
Fixes from frugalware: few 'typos' included while patching
Also re-added Judd's dependancy fix in libalpm/deps.c
Diffstat (limited to 'lib/libalpm/deps.c')
-rw-r--r-- | lib/libalpm/deps.c | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index 8249c651..2d28fde0 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -307,11 +307,28 @@ pmlist_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, unsigned char op, pmlist } } } - /* 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_t *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_t *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; @@ -334,13 +351,13 @@ pmlist_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, unsigned char op, pmlist 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; @@ -362,7 +379,6 @@ pmlist_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, unsigned char op, pmlist } FREE(ver); } - FREELISTPTR(k); } } /* else if still not found... */ |