File 0010-zypp-ignore-system-resolvables-during-install-too.patch of Package PackageKit

From c4e3c0fe11ce787c7925d4e208a698dda4c32968 Mon Sep 17 00:00:00 2001
From: Stephan Kulow <coolo@suse.de>
Date: Mon, 21 Jan 2013 17:15:44 +0100
Subject: [PATCH 2/2] zypp: ignore system resolvables during install too

There is no perfect solution for that, but if I install something,
everything that is upgraded will have a replacement from the repo,
so listing it, is not interesting to me.

problem is that pkcon says I need to install foo-1.2 if in reality
there is an update going on from foo-1.1 to foo-1.2, but as packages
are identified by their name+version+repo, I have to pick one
---
 backends/zypp/pk-backend-zypp.cpp | 39 +++++++++++++++++++++++----------------
 1 file changed, 23 insertions(+), 16 deletions(-)

diff --git a/backends/zypp/pk-backend-zypp.cpp b/backends/zypp/pk-backend-zypp.cpp
index c4f6e02..0d8f51a 100644
--- a/backends/zypp/pk-backend-zypp.cpp
+++ b/backends/zypp/pk-backend-zypp.cpp
@@ -1396,15 +1396,15 @@ zypp_perform_execution (PkBackendJob *job, ZYpp::Ptr zypp, PerformType type, gbo
 		}
 
 		switch (type) {
-			case INSTALL:
-				pk_backend_job_set_status (job, PK_STATUS_ENUM_INSTALL);
-				break;
-			case REMOVE:
-				pk_backend_job_set_status (job, PK_STATUS_ENUM_REMOVE);
-				break;
-			case UPDATE:
-				pk_backend_job_set_status (job, PK_STATUS_ENUM_UPDATE);
-				break;
+		case INSTALL:
+			pk_backend_job_set_status (job, PK_STATUS_ENUM_INSTALL);
+			break;
+		case REMOVE:
+			pk_backend_job_set_status (job, PK_STATUS_ENUM_REMOVE);
+			break;
+		case UPDATE:
+			pk_backend_job_set_status (job, PK_STATUS_ENUM_UPDATE);
+			break;
 		}
 
 		ResPool pool = ResPool::instance ();
@@ -1414,14 +1414,21 @@ zypp_perform_execution (PkBackendJob *job, ZYpp::Ptr zypp, PerformType type, gbo
 			MIL << "simulating" << endl;
 
 			for (ResPool::const_iterator it = pool.begin (); it != pool.end (); ++it) {
-				if (type == REMOVE && !(*it)->isSystem ()) {
-					it->statusReset ();
-					continue;
+				switch (type) {
+				case REMOVE:
+					if (!(*it)->isSystem ()) {
+						it->statusReset ();
+						continue;
+					}
+					break;
+				case INSTALL:
+				case UPDATE:
+					// for updates we only care for updates
+					if (it->status ().isToBeUninstalledDueToUpgrade ())
+						continue;
+					break;
 				}
-				// for updates we only care for updates
-				if (type == UPDATE && it->status ().isToBeUninstalledDueToUpgrade ())
-					continue;
-
+				
 				if (!zypp_backend_pool_item_notify (job, *it, TRUE))
 					ret = FALSE;
 				it->statusReset ();
-- 
1.8.1.1

openSUSE Build Service is sponsored by