File PackageKit-zypp-ignore-already-installed-packages.patch of Package PackageKit.openSUSE_Leap_15.2_Update

From d9233011cbc7b69f5318ae2c2e03712e11e3dea0 Mon Sep 17 00:00:00 2001
From: Jonathan Kang <jonathankang@gnome.org>
Date: Wed, 11 Mar 2020 09:37:19 +0800
Subject: [PATCH] zypp: Ignore already installed package when installing

Previously, when users are installing multiple packages at the same
time using "pkcon install", if one/some of those packages is/are already
installed, the whole installing process terminates, withouting
installing those uninstalled packages.

Fix that by ignoring those already installed pacakge and proceeding to
install those which are not yet installed.
---
 backends/zypp/pk-backend-zypp.cpp | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/backends/zypp/pk-backend-zypp.cpp b/backends/zypp/pk-backend-zypp.cpp
index 9aa24741c..62b78ec0c 100644
--- a/backends/zypp/pk-backend-zypp.cpp
+++ b/backends/zypp/pk-backend-zypp.cpp
@@ -2785,12 +2785,7 @@ backend_install_packages_thread (PkBackendJob *job, GVariant *params, gpointer u
 			if (relations[i] == EQUAL_VERSION &&
 			    !pk_bitfield_contain (transaction_flags,
 						  PK_TRANSACTION_FLAG_ENUM_ALLOW_REINSTALL)) {
-				g_autofree gchar *printable_tmp = pk_package_id_to_printable (package_ids[i]);
-				pk_backend_job_error_code (job,
-							   PK_ERROR_ENUM_PACKAGE_ALREADY_INSTALLED,
-							   "%s is already installed",
-							   printable_tmp);
-				return;
+				continue;
 			}
 
 			if (relations[i] == OLDER_VERSION &&
-- 
2.24.0

openSUSE Build Service is sponsored by