From a3264cf5fa25468bf81ee0ebe7f8ff0abd343674 Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Tue, 1 Nov 2016 11:09:42 +0900 Subject: [PATCH] Imported Upstream version 15.22.2 Change-Id: Iff04a1a43994c9935f3de5a27dd5d6edc525ba36 Signed-off-by: DongHun Kwak --- VERSION.cmake | 4 ++-- package/libzypp.changes | 6 ++++++ zypp/ResolverProblem.cc | 30 ++++++++++++++++++++++++++---- 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/VERSION.cmake b/VERSION.cmake index 48365b0..a48a02e 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -61,8 +61,8 @@ SET(LIBZYPP_MAJOR "15") SET(LIBZYPP_COMPATMINOR "19") SET(LIBZYPP_MINOR "22") -SET(LIBZYPP_PATCH "1") +SET(LIBZYPP_PATCH "2") # -# LAST RELEASED: 15.22.1 (19) +# LAST RELEASED: 15.22.2 (19) # (The number in parenthesis is LIBZYPP_COMPATMINOR) #======= diff --git a/package/libzypp.changes b/package/libzypp.changes index b5b0b0b..9c98731 100644 --- a/package/libzypp.changes +++ b/package/libzypp.changes @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Tue Jun 21 11:06:56 CEST 2016 - ma@suse.de + +- Filter duplicate resolver solutions (bsc#985674) +- version 15.22.2 (19) + +------------------------------------------------------------------- Wed Jun 15 12:41:17 CEST 2016 - ma@suse.de - Fix bug in removeRepository which may keep an empty .repo file diff --git a/zypp/ResolverProblem.cc b/zypp/ResolverProblem.cc index 3fe1b9b..980c77e 100644 --- a/zypp/ResolverProblem.cc +++ b/zypp/ResolverProblem.cc @@ -33,6 +33,25 @@ namespace zypp { IMPL_PTR_TYPE(ResolverProblem); + ///////////////////////////////////////////////////////////////////////// + namespace + { + // HACK for bsc#985674: filter duplicate solutions + // + inline bool solutionInList( const ProblemSolutionList & solutions_r, const ProblemSolution_Ptr & solution_r ) + { + for ( const ProblemSolution_Ptr & solution : solutions_r ) + { + if ( solution->description() == solution_r->description() + && solution->details() == solution_r->details() + && solution->actions().size() == solution_r->actions().size() ) + return true; + } + return false; + } + } // namespace + ///////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////// /// \class ResolverProblem::Impl /// \brief ResolverProblem implementation. @@ -97,10 +116,13 @@ namespace zypp void ResolverProblem::addSolution( ProblemSolution_Ptr solution, bool inFront ) { - if (inFront) - { _pimpl->_solutions.push_front( solution ); } - else - { _pimpl->_solutions.push_back( solution ); } + if ( ! solutionInList( _pimpl->_solutions, solution ) ) // bsc#985674: filter duplicate solutions + { + if (inFront) + { _pimpl->_solutions.push_front( solution ); } + else + { _pimpl->_solutions.push_back( solution ); } + } } -- 2.7.4