From 00628c7268e3b81045961be51a0ca640aea368b0 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 6 Jul 2011 09:18:59 -0500 Subject: Unify package removal code This code duplication has always been a rather clumsy casuality of fixing some past upgrade issues. Unify the removal code across upgrade and remove operations into a new _alpm_remove_single_package() method wihch makes it very clear how we handle upgrade and remove differently, via several conditionals on newpkg. This commit highlights interesting behavior such as the fact that the implicit removal in every package upgrade never gets transaction events or progress callbacks. Signed-off-by: Dan McGee --- lib/libalpm/remove.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/libalpm/remove.h') diff --git a/lib/libalpm/remove.h b/lib/libalpm/remove.h index 48dc2e9c..5da645b0 100644 --- a/lib/libalpm/remove.h +++ b/lib/libalpm/remove.h @@ -27,8 +27,9 @@ int _alpm_remove_prepare(alpm_handle_t *handle, alpm_list_t **data); int _alpm_remove_packages(alpm_handle_t *handle); -int _alpm_upgraderemove_package(alpm_handle_t *handle, - alpm_pkg_t *oldpkg, alpm_pkg_t *newpkg); +int _alpm_remove_single_package(alpm_handle_t *handle, + alpm_pkg_t *oldpkg, alpm_pkg_t *newpkg, + size_t targ_count, size_t pkg_count); #endif /* _ALPM_REMOVE_H */ -- cgit v1.2.3-24-g4f1b