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/add.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libalpm/add.c') diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index 9ed4d818..e1827469 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -506,7 +506,7 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg, if(oldpkg) { /* set up fake remove transaction */ - if(_alpm_upgraderemove_package(handle, oldpkg, newpkg) == -1) { + if(_alpm_remove_single_package(handle, oldpkg, newpkg, 0, 0) == -1) { handle->pm_errno = ALPM_ERR_TRANS_ABORT; ret = -1; goto cleanup; -- cgit v1.2.3