[packagekit] [PATCH 4/5] zypp: Honor force parameter in zypp_refresh_meta_and_cache
Thomas Perl
thomas.perl at jolla.com
Wed Jan 22 02:31:51 PST 2014
Makes sure libzypp actually refreshes repositories when we explicitly
force a refresh (otherwise, refresh on a "if needed" basis).
---
backends/zypp/pk-backend-zypp.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/backends/zypp/pk-backend-zypp.cpp b/backends/zypp/pk-backend-zypp.cpp
index a3c8040..7e9d8c9 100644
--- a/backends/zypp/pk-backend-zypp.cpp
+++ b/backends/zypp/pk-backend-zypp.cpp
@@ -1015,8 +1015,11 @@ class AbortTransactionException {
static gboolean
zypp_refresh_meta_and_cache (RepoManager &manager, RepoInfo &repo, bool force = false)
{
+ zypp::RepoManager::RawMetadataRefreshPolicy refreshPolicy =
+ force ? RepoManager::RefreshForced : RepoManager::RefreshIfNeeded;
+
try {
- if (manager.checkIfToRefreshMetadata (repo, repo.url()) //RepoManager::RefreshIfNeededIgnoreDelay)
+ if (manager.checkIfToRefreshMetadata (repo, repo.url(), refreshPolicy)
!= RepoManager::REFRESH_NEEDED)
return TRUE;
--
1.8.5.2
More information about the PackageKit
mailing list