summaryrefslogtreecommitdiff
path: root/lib/libalpm/deps.c
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2005-03-28 08:25:33 +0000
committerAurelien Foret <aurelien@archlinux.org>2005-03-28 08:25:33 +0000
commit61231c9ba86456e424bc45354feeb91cc52119f8 (patch)
treeb0047d9bd97c9bbe87c299ac3361008be3b00588 /lib/libalpm/deps.c
parent56917dc30493680219e0eceddbf178242522f11d (diff)
downloadpacman-61231c9ba86456e424bc45354feeb91cc52119f8.tar.xz
replaced occ of list_free() by FREELIST/FREELISTPTR macros
Diffstat (limited to 'lib/libalpm/deps.c')
-rw-r--r--lib/libalpm/deps.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c
index eee5bcc5..29033f88 100644
--- a/lib/libalpm/deps.c
+++ b/lib/libalpm/deps.c
@@ -175,7 +175,6 @@ PMList *checkdeps(pmdb_t *db, unsigned short op, PMList *packages)
}
}
if(found == 0) {
- PMList *lp;
/* look for packages that list depend.name as a "provide" */
PMList *provides = _alpm_db_whatprovides(db, depend.name);
if(provides == NULL) {
@@ -184,10 +183,7 @@ PMList *checkdeps(pmdb_t *db, unsigned short op, PMList *packages)
continue;
}
/* we found an installed package that provides depend.name */
- for(lp = provides; lp; lp = lp->next) {
- lp->data = NULL;
- }
- pm_list_free(provides);
+ FREELISTPTR(provides);
}
found = 0;
if(depend.mod == PM_DEP_ANY) {
@@ -306,7 +302,7 @@ PMList *checkdeps(pmdb_t *db, unsigned short op, PMList *packages)
}
k->data = NULL;
}
- pm_list_free(provs);
+ FREELIST(provs);
}*/
/* DEPENDENCIES -- look for unsatisfied dependencies */
@@ -371,7 +367,6 @@ PMList *checkdeps(pmdb_t *db, unsigned short op, PMList *packages)
}
/* check database for provides matches */
if(!found){
- PMList *lp;
k = _alpm_db_whatprovides(db, depend.name);
if(k) {
/* grab the first one (there should only really be one, anyway) */
@@ -380,10 +375,7 @@ PMList *checkdeps(pmdb_t *db, unsigned short op, PMList *packages)
/* wtf */
_alpm_log(PM_LOG_ERROR, "%s supposedly provides %s, but it was not found in db",
((pmpkg_t *)k->data)->name, depend.name);
- for(lp = k; lp; lp = lp->next) {
- lp->data = NULL;
- }
- pm_list_free(k);
+ FREELISTPTR(k);
continue;
}
if(depend.mod == PM_DEP_ANY) {
@@ -408,10 +400,7 @@ PMList *checkdeps(pmdb_t *db, unsigned short op, PMList *packages)
FREE(ver);
}
}
- for(lp = k; lp; lp = lp->next) {
- lp->data = NULL;
- }
- pm_list_free(k);
+ FREELISTPTR(k);
}
/* else if still not found... */
if(!found) {
@@ -556,13 +545,12 @@ PMList* removedeps(pmdb_t *db, PMList *targs)
int resolvedeps(pmdb_t *local, PMList *databases, pmsync_t *sync, PMList *list, PMList *trail, PMList **data)
{
PMList *i, *j;
- PMList *targ = NULL;
+ PMList *targ;
PMList *deps = NULL;
- targ = pm_list_add(targ, sync->spkg);
+ targ = pm_list_add(NULL, sync->spkg);
deps = checkdeps(local, PM_TRANS_TYPE_ADD, targ);
- targ->data = NULL;
- pm_list_free(targ);
+ FREELISTPTR(targ);
if(deps == NULL) {
return(0);