[packagekit] [PATCH 6/6] Erase old solv data from sat Pool while refreshing

Zhang Qiang qiang.z.zhang at intel.com
Tue Sep 7 02:04:14 PDT 2010


In the original implementation, pkcon refresh only refresh/build
metadata, while solv file have not been refreshed properly. this patch
refresh solv data in solv pool while execute refresh operation.

Reference zypper's implementation, changed refreshMetadata flag from 
RefreshIfNeeded to RefreshIfNeededIgnoreDelay, or refresh will not 
work properly.

Related bug: http://bugs.meego.com/show_bug.cgi?id=375
---
 backends/zypp/zypp-utils.cpp |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/backends/zypp/zypp-utils.cpp b/backends/zypp/zypp-utils.cpp
index c7ed903..be58197 100644
--- a/backends/zypp/zypp-utils.cpp
+++ b/backends/zypp/zypp-utils.cpp
@@ -454,13 +454,18 @@ class AbortTransactionException {
 gboolean
 zypp_refresh_meta_and_cache (zypp::RepoManager &manager, zypp::RepoInfo &repo, bool force)
 {
+	zypp::sat::Pool pool = zypp::sat::Pool::instance ();
+
 	try {
+		// Erase old solv file
+		pool.reposErase (repo.alias ());
 		manager.refreshMetadata (repo, force ?
 					 zypp::RepoManager::RefreshForced :
-					 zypp::RepoManager::RefreshIfNeeded);
+					 zypp::RepoManager::RefreshIfNeededIgnoreDelay);
 		manager.buildCache (repo, force ?
 				    zypp::RepoManager::BuildForced :
 				    zypp::RepoManager::BuildIfNeeded);
+		manager.loadFromCache (repo);
 		return TRUE;
 	} catch (const AbortTransactionException &ex) {
 		return FALSE;
-- 
1.7.1.1




More information about the PackageKit mailing list