Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/add.c
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2005-03-27 07:41:51 +0000
committerAurelien Foret <aurelien@archlinux.org>2005-03-27 07:41:51 +0000
commitc0cf6c422d96893436912d12dd651f3f971070ed (patch)
tree9c207025ac819707f906eb6623eb089024d1eeb0 /lib/libalpm/add.c
parente39d05b31b67c9cbc3379d44751fb6f3403c3911 (diff)
made 'provides' actually work when updating 'requiredby' fields from deps
Diffstat (limited to 'lib/libalpm/add.c')
-rw-r--r--lib/libalpm/add.c16
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 {