Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Maintenance:62
PackageKit.openSUSE_12.1
0004-Workaround-Don-t-refresh-repositories-each...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0004-Workaround-Don-t-refresh-repositories-each-time-for-.patch of Package PackageKit.openSUSE_12.1
From e57cf1f8fbce05ede350f9be31557478de8a040f Mon Sep 17 00:00:00 2001 From: Duncan Mac-Vicar P <dmacvicar@suse.de> Date: Wed, 19 Oct 2011 12:53:07 +0200 Subject: [PATCH 4/5] Workaround: Don't refresh repositories each time for operations called in batches like package search. --- backends/zypp/pk-backend-zypp.cpp | 23 +++++++++++++++++------ 1 files changed, 17 insertions(+), 6 deletions(-) diff --git a/backends/zypp/pk-backend-zypp.cpp b/backends/zypp/pk-backend-zypp.cpp index e885cb0..a893977 100644 --- a/backends/zypp/pk-backend-zypp.cpp +++ b/backends/zypp/pk-backend-zypp.cpp @@ -1398,6 +1398,8 @@ pk_backend_resolve (PkBackend *backend, PkBitfield filters, gchar **package_ids) static gboolean backend_find_packages_thread (PkBackend *backend) { + static bool refreshed = false; + MIL << endl; gchar **values; const gchar *search; @@ -1411,9 +1413,13 @@ backend_find_packages_thread (PkBackend *backend) } // refresh the repos before searching - if (!zypp_refresh_cache (backend, FALSE)) { - pk_backend_finished (backend); - return FALSE; + if (!refreshed) { + if (!zypp_refresh_cache (backend, FALSE)) { + pk_backend_finished (backend); + return FALSE; + } + else + refreshed = true; } values = pk_backend_get_strv (backend, "search"); @@ -2075,10 +2081,15 @@ backend_download_packages_thread (PkBackend *backend) MIL << endl; gchar **package_ids; gulong size = 0; + static bool refreshed = false; - if (!zypp_refresh_cache (backend, FALSE)) { - pk_backend_finished (backend); - return FALSE; + if (! refreshed) { + if (!zypp_refresh_cache (backend, FALSE)) { + pk_backend_finished (backend); + return FALSE; + } + else + refreshed = true; } ZYpp::Ptr zypp; -- 1.7.6.4
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor