summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/trans.c
diff options
context:
space:
mode:
authorNagy Gabor <ngaba@bibl.u-szeged.hu>2009-06-07 14:30:11 +0200
committerDan McGee <dan@archlinux.org>2009-06-07 22:11:16 +0200
commit19b8b638851713da64dd2aa7ff31e911ffe925cd (patch)
tree20ca058a5f6b1ffab444b0c09e98a85d16f09455 /lib/libalpm/trans.c
parente61ab1536f4b198ac5c62cf68d706d93bc6481be (diff)
downloadpacman-19b8b638851713da64dd2aa7ff31e911ffe925cd.tar.gz
pacman-19b8b638851713da64dd2aa7ff31e911ffe925cd.tar.xz
Introduce _alpm_pkg_free_trans()
The main purpose of this function to make our code more readable. It frees transaction specific fields of pmpkg_t. (It is used when a package is removed from the target list.) Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/trans.c')
-rw-r--r--lib/libalpm/trans.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c
index 64bec84e..fcbb5e2f 100644
--- a/lib/libalpm/trans.c
+++ b/lib/libalpm/trans.c
@@ -248,12 +248,7 @@ void _alpm_trans_free(pmtrans_t *trans)
}
if(trans->type == PM_TRANS_TYPE_SYNC) {
- alpm_list_t *i;
- for(i = trans->packages; i; i = i->next) {
- pmpkg_t *pkg = i->data;
- alpm_list_free(pkg->removes);
- pkg->removes = NULL;
- }
+ alpm_list_free_inner(trans->packages, (alpm_list_fn_free)_alpm_pkg_free_trans);
} else {
alpm_list_free_inner(trans->packages, (alpm_list_fn_free)_alpm_pkg_free);
}