1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-08-13 17:03:46 -04:00

remove.c: downgrade TRANS_DUP_TARGET to warning

Matches the behavior for sync packages.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Andrew Gregory 2014-05-05 22:34:15 -04:00 committed by Allan McRae
parent 00fbdabc55
commit 060d06d2f7
2 changed files with 11 additions and 5 deletions

View File

@ -43,10 +43,16 @@ static int remove_target(const char *target)
if((pkg = alpm_db_get_pkg(db_local, target)) != NULL) { if((pkg = alpm_db_get_pkg(db_local, target)) != NULL) {
if(alpm_remove_pkg(config->handle, pkg) == -1) { if(alpm_remove_pkg(config->handle, pkg) == -1) {
pm_printf(ALPM_LOG_ERROR, "'%s': %s\n", target, alpm_errno_t err = alpm_errno(config->handle);
alpm_strerror(alpm_errno(config->handle))); if(err == ALPM_ERR_TRANS_DUP_TARGET) {
/* just skip duplicate targets */
pm_printf(ALPM_LOG_WARNING, _("skipping target: %s\n"), target);
return 0;
} else {
pm_printf(ALPM_LOG_ERROR, "'%s': %s\n", target, alpm_strerror(err));
return -1; return -1;
} }
}
config->explicit_removes = alpm_list_add(config->explicit_removes, pkg); config->explicit_removes = alpm_list_add(config->explicit_removes, pkg);
return 0; return 0;
} }

View File

@ -5,5 +5,5 @@ self.addpkg2db("local", p)
self.args = "-R " + "foo "*5 self.args = "-R " + "foo "*5
self.addrule("PACMAN_RETCODE=1") self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_EXIST=foo") self.addrule("!PKG_EXIST=foo")