From 4f04a589eaf59ab1569d4c88306caf3459f6b7d3 Mon Sep 17 00:00:00 2001 From: Stefan Schubert Date: Fri, 24 Feb 2006 10:37:39 +0000 Subject: [PATCH] cleanup in solver solutions; added general solution in not fulfilled requirements --- zypp/solver/detail/ResolverContext.cc | 17 ++++++++++++----- zypp/solver/detail/Resolver_problems.cc | 17 +++++++++++++++-- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/zypp/solver/detail/ResolverContext.cc b/zypp/solver/detail/ResolverContext.cc index 156fe56..077d5cd 100644 --- a/zypp/solver/detail/ResolverContext.cc +++ b/zypp/solver/detail/ResolverContext.cc @@ -380,11 +380,18 @@ ResolverContext::uninstall (PoolItem_Ref item, bool part_of_upgrade, bool due_to ResolverInfoList addList; for (ResolverInfoList::const_iterator iter = _log.begin(); iter != _log.end(); iter++) { ResolverInfo_Ptr info = *iter; -// if (info->affected() == item - if (info->type() == RESOLVER_INFO_TYPE_CONFLICT_CANT_INSTALL - || info->type() == RESOLVER_INFO_TYPE_NO_PROVIDER - || info->type() == RESOLVER_INFO_TYPE_NO_OTHER_PROVIDER - || info->type() == RESOLVER_INFO_TYPE_CANT_SATISFY) + if (info->type() == RESOLVER_INFO_TYPE_CONFLICT_CANT_INSTALL) { + ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast(info); + if (info->affected() == item + || misc_info->other() == item) { + // put the info on the end as error + found = true; + addList.push_back (info); + } + } else if ( ((info->type() == RESOLVER_INFO_TYPE_NO_PROVIDER + || info->type() == RESOLVER_INFO_TYPE_NO_OTHER_PROVIDER + && info->affected() == item)) + || info->type() == RESOLVER_INFO_TYPE_CANT_SATISFY) { // put the info on the end as error found = true; diff --git a/zypp/solver/detail/Resolver_problems.cc b/zypp/solver/detail/Resolver_problems.cc index 4a450bb..d125f3f 100644 --- a/zypp/solver/detail/Resolver_problems.cc +++ b/zypp/solver/detail/Resolver_problems.cc @@ -448,8 +448,21 @@ Resolver::problems (void) const // uninstall problem->addSolution (new ProblemSolutionUninstall (problem, item)); - // Unflag requirement - problem->addSolution (new ProblemSolutionIgnoreRequires (problem, item, misc_info->capability())); + // Unflag requirement for this item + problem->addSolution (new ProblemSolutionIgnoreRequires (problem, item, misc_info->capability())); + + // Unflag ALL require + // Evaluating all require Items + AllRequires info; + Dep dep( Dep::REQUIRES ); + + invokeOnEach( _pool.byCapabilityIndexBegin( misc_info->capability().index(), dep ), // begin() + _pool.byCapabilityIndexEnd( misc_info->capability().index(), dep ), // end() + resfilter::ByCapMatch( misc_info->capability() ), + functor::functorRef(info) ); + if (info.requirers.size() > 1) + problem->addSolution (new ProblemSolutionIgnoreRequires (problem, info.requirers, misc_info->capability())); + problems.push_back (problem); problem_created = true; } -- 2.7.4