summaryrefslogtreecommitdiff
path: root/lib/libalpm/sync.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2007-04-26 21:08:34 -0400
committerDan McGee <dan@archlinux.org>2007-04-28 02:59:58 -0400
commita3491224df3209563b68cc45b9b2d8ab747d208a (patch)
tree46f0b25b5c457479cc937e10957562ce751cd9fd /lib/libalpm/sync.c
parent0984dab1f2b7beae455518b06aa5675890e01d9c (diff)
downloadpacman-a3491224df3209563b68cc45b9b2d8ab747d208a.tar.xz
Remove FREEPKG macro and correctly type _alpm_pkg_free
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/sync.c')
-rw-r--r--lib/libalpm/sync.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 10d1eb61..c0b01da0 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -84,9 +84,15 @@ void _alpm_sync_free(pmsyncpkg_t *sync)
/* TODO wow this is ugly */
if(sync->type == PM_SYNC_TYPE_REPLACE) {
- FREELISTPKGS(sync->data);
+ alpm_list_t *tmp;
+ for(tmp = sync->data; tmp; tmp = alpm_list_next(tmp)) {
+ _alpm_pkg_free(tmp->data);
+ tmp->data = NULL;
+ }
+ sync->data = NULL;
} else {
- FREEPKG(sync->data);
+ _alpm_pkg_free(sync->data);
+ sync->data = NULL;
}
FREE(sync);
}
@@ -148,7 +154,7 @@ static int find_replacements(pmtrans_t *trans, pmdb_t *db_local,
/* none found -- enter pkg into the final sync list */
sync = _alpm_sync_new(PM_SYNC_TYPE_REPLACE, spkg, NULL);
if(sync == NULL) {
- FREEPKG(dummy);
+ _alpm_pkg_free(dummy);
pm_errno = PM_ERR_MEMORY;
goto error;
}
@@ -229,7 +235,7 @@ int _alpm_sync_sysupgrade(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_s
}
sync = _alpm_sync_new(PM_SYNC_TYPE_UPGRADE, spkg, tmp);
if(sync == NULL) {
- FREEPKG(tmp);
+ _alpm_pkg_free(tmp);
goto error;
}
trans->packages = alpm_list_add(trans->packages, sync);
@@ -346,7 +352,7 @@ int _alpm_sync_addtarget(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sy
}
sync = _alpm_sync_new(PM_SYNC_TYPE_UPGRADE, spkg, dummy);
if(sync == NULL) {
- FREEPKG(dummy);
+ _alpm_pkg_free(dummy);
RET_ERR(PM_ERR_MEMORY, -1);
}
_alpm_log(PM_LOG_DEBUG, _("adding target '%s' to the transaction set"),
@@ -591,7 +597,8 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync
if(sync->type != PM_SYNC_TYPE_REPLACE) {
/* switch this sync type to REPLACE */
sync->type = PM_SYNC_TYPE_REPLACE;
- FREEPKG(sync->data);
+ _alpm_pkg_free(sync->data);
+ sync->data = NULL;
}
/* append to the replaces list */
_alpm_log(PM_LOG_DEBUG, _("electing '%s' for removal"), miss->depend.name);