From f28ddd9d93ba5e16848cc2ed85a38cec4d2f2b65 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Fri, 16 Nov 2018 19:47:30 -0800 Subject: check localdb before upgrading package Commit 2ee7a8d89ad693617307260604e1d58757fd2978 replaced a manual check for a local package with a check for the "oldpkg" member, which gets set at the beginning of the transaction. If the package was also in the remove list, such as when a package gets replaced, it would no longer be in the local db and pacman would try to remove it twice, resulting in superfluous error messages. Fixes: FS#50875, FS#55534 Signed-off-by: Andrew Gregory Signed-off-by: Allan McRae --- 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 5a3e06b8..e415bb17 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -427,7 +427,7 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg, ASSERT(trans != NULL, return -1); /* see if this is an upgrade. if so, remove the old package first */ - if((oldpkg = newpkg->oldpkg)) { + if(_alpm_db_get_pkgfromcache(db, newpkg->name) && (oldpkg = newpkg->oldpkg)) { int cmp = _alpm_pkg_compare_versions(newpkg, oldpkg); if(cmp < 0) { log_msg = "downgrading"; -- cgit v1.2.3-54-g00ecf