summaryrefslogtreecommitdiff
path: root/lib/libalpm/remove.c
diff options
context:
space:
mode:
authorMichael Straube <michael.straube@posteo.de>2018-12-14 21:44:24 +0100
committerAllan McRae <allan@archlinux.org>2019-01-04 11:31:55 +1000
commit3a5a0d53bced32b42fd553952c2f74d52981d9ef (patch)
treed5c520c877e4b1559193ffcea63c79e9f1e05ea2 /lib/libalpm/remove.c
parent984492b92f1b35534adddc24c2439fcdcb9885af (diff)
downloadpacman-3a5a0d53bced32b42fd553952c2f74d52981d9ef.tar.xz
Move skipping of duplicate sync/remove targets into libalpm
sync: As pointed out by Andrew Gregory there could be an error when adding duplicates if they are two separate packages with the same name. Add a check in alpm_add_pkg() to test whether the duplicate is actually the same package, and if so, log a debug message and return success to skip the package. If the duplicate is a different package return ALPM_ERR_TRANS_DUP_TARGET and treat that error just like any other error in pacman. remove: Change alpm_remove_pkg() to just log a debug message and return success to skip duplicates. Remove the handling of ALPM_ERR_TRANS_DUP_TARGET in pacman. Also fixes FS#49377. Suggested-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Michael Straube <michael.straube@posteo.de> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm/remove.c')
-rw-r--r--lib/libalpm/remove.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c
index 78ca5be7..50de4649 100644
--- a/lib/libalpm/remove.c
+++ b/lib/libalpm/remove.c
@@ -74,7 +74,8 @@ int SYMEXPORT alpm_remove_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg)
pkgname = pkg->name;
if(alpm_pkg_find(trans->remove, pkgname)) {
- RET_ERR(handle, ALPM_ERR_TRANS_DUP_TARGET, -1);
+ _alpm_log(handle, ALPM_LOG_DEBUG, "skipping duplicate target: %s\n", pkgname);
+ return 0;
}
_alpm_log(handle, ALPM_LOG_DEBUG, "adding package %s to the transaction remove list\n",