[packagekit] [PATCH 4/6] Refresh system rpmdb while refresh cache
Zhang Qiang
qiang.z.zhang at intel.com
Tue Sep 7 02:02:20 PDT 2010
Refreshing rpmdb is necessary, which can let packagekitd get the
correct status of packages, even if you use rpm command to change the
status of rpmdb while packagekit is running.
---
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 d78b118..c7ed903 100644
--- a/backends/zypp/zypp-utils.cpp
+++ b/backends/zypp/zypp-utils.cpp
@@ -1044,7 +1044,12 @@ gboolean
zypp_refresh_cache (PkBackend *backend, gboolean force)
{
// This call is needed as it calls initializeTarget which appears to properly setup the keyring
- get_zypp (backend);
+ zypp::ZYpp::Ptr zypp = get_zypp (backend);
+ zypp::filesystem::Pathname pathname(pk_backend_get_root (backend));
+ // This call is needed to refresh system rpmdb status while refresh cache
+ zypp->finishTarget ();
+ zypp->initializeTarget (pathname);
+
if (!pk_backend_is_online (backend)) {
pk_backend_error_code (backend, PK_ERROR_ENUM_NO_NETWORK, "Cannot refresh cache whilst offline");
return FALSE;
--
1.7.1.1
More information about the PackageKit
mailing list