1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-22 15:58:50 -05:00

replaced occ of list_free() by FREELIST/FREELISTPTR macros

This commit is contained in:
Aurelien Foret 2005-03-28 08:25:33 +00:00
parent 56917dc304
commit 61231c9ba8

View File

@ -175,7 +175,6 @@ PMList *checkdeps(pmdb_t *db, unsigned short op, PMList *packages)
} }
} }
if(found == 0) { if(found == 0) {
PMList *lp;
/* look for packages that list depend.name as a "provide" */ /* look for packages that list depend.name as a "provide" */
PMList *provides = _alpm_db_whatprovides(db, depend.name); PMList *provides = _alpm_db_whatprovides(db, depend.name);
if(provides == NULL) { if(provides == NULL) {
@ -184,10 +183,7 @@ PMList *checkdeps(pmdb_t *db, unsigned short op, PMList *packages)
continue; continue;
} }
/* we found an installed package that provides depend.name */ /* we found an installed package that provides depend.name */
for(lp = provides; lp; lp = lp->next) { FREELISTPTR(provides);
lp->data = NULL;
}
pm_list_free(provides);
} }
found = 0; found = 0;
if(depend.mod == PM_DEP_ANY) { if(depend.mod == PM_DEP_ANY) {
@ -306,7 +302,7 @@ PMList *checkdeps(pmdb_t *db, unsigned short op, PMList *packages)
} }
k->data = NULL; k->data = NULL;
} }
pm_list_free(provs); FREELIST(provs);
}*/ }*/
/* DEPENDENCIES -- look for unsatisfied dependencies */ /* DEPENDENCIES -- look for unsatisfied dependencies */
@ -371,7 +367,6 @@ PMList *checkdeps(pmdb_t *db, unsigned short op, PMList *packages)
} }
/* check database for provides matches */ /* check database for provides matches */
if(!found){ if(!found){
PMList *lp;
k = _alpm_db_whatprovides(db, depend.name); k = _alpm_db_whatprovides(db, depend.name);
if(k) { if(k) {
/* grab the first one (there should only really be one, anyway) */ /* 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 */ /* wtf */
_alpm_log(PM_LOG_ERROR, "%s supposedly provides %s, but it was not found in db", _alpm_log(PM_LOG_ERROR, "%s supposedly provides %s, but it was not found in db",
((pmpkg_t *)k->data)->name, depend.name); ((pmpkg_t *)k->data)->name, depend.name);
for(lp = k; lp; lp = lp->next) { FREELISTPTR(k);
lp->data = NULL;
}
pm_list_free(k);
continue; continue;
} }
if(depend.mod == PM_DEP_ANY) { if(depend.mod == PM_DEP_ANY) {
@ -408,10 +400,7 @@ PMList *checkdeps(pmdb_t *db, unsigned short op, PMList *packages)
FREE(ver); FREE(ver);
} }
} }
for(lp = k; lp; lp = lp->next) { FREELISTPTR(k);
lp->data = NULL;
}
pm_list_free(k);
} }
/* else if still not found... */ /* else if still not found... */
if(!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) int resolvedeps(pmdb_t *local, PMList *databases, pmsync_t *sync, PMList *list, PMList *trail, PMList **data)
{ {
PMList *i, *j; PMList *i, *j;
PMList *targ = NULL; PMList *targ;
PMList *deps = NULL; 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); deps = checkdeps(local, PM_TRANS_TYPE_ADD, targ);
targ->data = NULL; FREELISTPTR(targ);
pm_list_free(targ);
if(deps == NULL) { if(deps == NULL) {
return(0); return(0);