diff options
author | Aurelien Foret <aurelien@archlinux.org> | 2005-03-27 09:41:51 +0200 |
---|---|---|
committer | Aurelien Foret <aurelien@archlinux.org> | 2005-03-27 09:41:51 +0200 |
commit | c0cf6c422d96893436912d12dd651f3f971070ed (patch) | |
tree | 9c207025ac819707f906eb6623eb089024d1eeb0 /lib/libalpm/add.c | |
parent | e39d05b31b67c9cbc3379d44751fb6f3403c3911 (diff) | |
download | pacman-c0cf6c422d96893436912d12dd651f3f971070ed.tar.gz pacman-c0cf6c422d96893436912d12dd651f3f971070ed.tar.xz |
made 'provides' actually work when updating 'requiredby' fields from deps
Diffstat (limited to 'lib/libalpm/add.c')
-rw-r--r-- | lib/libalpm/add.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index b2cacf81..0bbf0755 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -98,9 +98,10 @@ int add_loadtarget(pmdb_t *db, pmtrans_t *trans, char *name) if(strcmp(pkg->name, info->name) == 0) { if(rpmvercmp(pkg->version, info->version) < 0) { - _alpm_log(PM_LOG_WARNING, "replacing older version of %s in target list", pkg->name); + _alpm_log(PM_LOG_WARNING, "replacing older version of %s %s by %s in target list", pkg->name, pkg->version, info->version); FREEPKG(j->data); j->data = info; + return(0); } else { pm_errno = PM_ERR_TRANS_DUP_TARGET; goto error; @@ -372,6 +373,7 @@ int add_commit(pmdb_t *db, pmtrans_t *trans) if(splitdep(lp->data, &depend)) { continue; } + /* ORE same thing here: we should browse the cache instead of using db_scan */ depinfo = db_scan(db, depend.name, INFRQ_DESC|INFRQ_DEPENDS); @@ -382,15 +384,15 @@ int add_commit(pmdb_t *db, pmtrans_t *trans) cache, thus eliminating the need for db_scan(DEPENDS) */ PMList *provides = _alpm_db_whatprovides(db, depend.name); if(provides) { + PMList *p; /* use the first one */ - depinfo = db_scan(db, ((pmpkg_t *)provides->data)->name, INFRQ_DEPENDS); + depinfo = db_scan(db, ((pmpkg_t *)provides->data)->name, INFRQ_DESC|INFRQ_DEPENDS); + for(p = provides; p; p = p->next) { + p->data = NULL; + } + FREELIST(provides); if(depinfo == NULL) { - PMList *lp; /* wtf */ - for(lp = provides; lp; lp = lp->next) { - lp->data = NULL; - } - FREELIST(provides); continue; } } else { |