Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Lachu:SystemServices
Lachu-PackageKit
0022-Compare-cache-with-problems-list.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0022-Compare-cache-with-problems-list.patch of Package Lachu-PackageKit
From 356804a3d1626b8f6752a947f680db7168269bb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20Lach?= <slawek@lach.art.pl> Date: Sat, 20 Feb 2021 12:20:55 +0100 Subject: [PATCH 22/46] - Compare cache with problems list --- backends/zypp/pk-backend-zypp.cpp | 71 ++++++++++++++++++++++++++++++- 1 file changed, 69 insertions(+), 2 deletions(-) diff --git a/backends/zypp/pk-backend-zypp.cpp b/backends/zypp/pk-backend-zypp.cpp index 2209a453d..e531c2932 100644 --- a/backends/zypp/pk-backend-zypp.cpp +++ b/backends/zypp/pk-backend-zypp.cpp @@ -2112,6 +2112,61 @@ static void apply_resoultion_from_cache(struct backend_job_private *backend, Res backend->msg_proc_helper->resolver->applySolutions(solution_list); } +static gboolean no_conflicts_between_cache_and_zypp(ResolverProblemList *problems1, std::list<struct problem> *problems2) +{ + + ResolverProblemList::iterator it; + ProblemSolutionList::const_iterator sol_it; + + if (NULL == problems1 && NULL == problems2) { + + return true; + } + + if (NULL == problems1) { + + return false; + } + + if (NULL == problems2) { + + return false; + } + + ResolverProblemList::iterator it1 = problems1->begin(); + std::list<struct problem>::iterator it2 = problems2->begin(); + + for (; (it1 != problems1->end()) && (it2 != problems2->end()); ++it1,++it2) { + + if ((*it1)->description() != (*it2).kind) { + + return false; + } + ProblemSolutionList::const_iterator sol_it1 = (*it1)->solutions().begin(); + std::list<string>::const_iterator sol_it2 = (*it2).solutions.begin(); + + for (; (sol_it1 != (*it1)->solutions().end()) && (sol_it2 != (*it2).solutions.end()); ++sol_it1, ++sol_it2) { + + if (get_full_resolution_text(**sol_it1) != *sol_it2) { + + return false; + } + } + + if ((sol_it1 != (*it1)->solutions().end()) || (sol_it2 != (*it2).solutions.end())) { + + return false; + } + } + + if ((it1 != problems1->end()) || (it2 != problems2->end())) { + + return false; + } + + return true; +} + static gboolean zypp_perform_execution (PkBackendJob *job, ZYpp::Ptr zypp, PerformType type, gboolean force, PkBitfield transaction_flags) { @@ -2299,7 +2354,12 @@ zypp_perform_execution (PkBackendJob *job, ZYpp::Ptr zypp, PerformType type, gbo changed = true; } - + + + if (!no_conflicts_between_cache_and_zypp(&problems, rjob->msg_proc_helper->problems2)) { + + changed = true; + } } // Manual intervention required to resolve dependencies @@ -2488,9 +2548,16 @@ zypp_perform_execution (PkBackendJob *job, ZYpp::Ptr zypp, PerformType type, gbo add_resolution_to_zypp(rjob->msg_proc_helper); apply_resoultion_from_cache(rjob, &rjob->msg_proc_helper->problems); - unlink(rjob->msg_proc_helper->path_to_cache); + // FIXME: Remove cache even if it shold be persist +#if 0 + if (!pk_bitfield_contain (transaction_flags, PK_TRANSACTION_FLAG_ENUM_SIMULATE)) { + + unlink(rjob->msg_proc_helper->path_to_cache); + } +#endif free(rjob->msg_proc_helper->path_to_cache); free(rjob->msg_proc_helper); + } } -- 2.32.0
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