From 19b8b638851713da64dd2aa7ff31e911ffe925cd Mon Sep 17 00:00:00 2001 From: Nagy Gabor Date: Sun, 7 Jun 2009 14:30:11 +0200 Subject: 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 Signed-off-by: Dan McGee --- lib/libalpm/package.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/libalpm/package.c') diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index b63b5ec0..8e41456e 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -857,6 +857,19 @@ void _alpm_pkg_free(pmpkg_t *pkg) FREE(pkg); } +/* Free transaction specific fields */ +void _alpm_pkg_free_trans(pmpkg_t *pkg) +{ + ALPM_LOG_FUNC; + + if(pkg == NULL) { + return; + } + + alpm_list_free(pkg->removes); + pkg->removes = NULL; +} + /* Is spkg an upgrade for locapkg? */ int _alpm_pkg_compare_versions(pmpkg_t *spkg, pmpkg_t *localpkg) { -- cgit v1.2.3-70-g09d2