From: Stefan Schubert Date: Tue, 14 Mar 2006 13:35:25 +0000 (+0000) Subject: bugfix for Bug156439 X-Git-Tag: BASE-SuSE-SLE-10-SP2-Branch~1553 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0b418972d42fa5034d54ed12671f3de7afa788e8;p=platform%2Fupstream%2Flibzypp.git bugfix for Bug156439 --- diff --git a/zypp/solver/detail/QueueItemUninstall.cc b/zypp/solver/detail/QueueItemUninstall.cc index b76f15b..e6d143c 100644 --- a/zypp/solver/detail/QueueItemUninstall.cc +++ b/zypp/solver/detail/QueueItemUninstall.cc @@ -346,39 +346,34 @@ QueueItemUninstall::process (ResolverContext_Ptr context, QueueItemList & qil) // we're uninstalling an installed item // loop over all its provides and check if any installed item requires // one of these provides - // We assuming that the dependencies are satified by the new updated items - // Testcase exercise-bug150844-test.xml - if (!context->upgradeMode()) - { - CapSet provides = _item->dep(Dep::PROVIDES); + CapSet provides = _item->dep(Dep::PROVIDES); - for (CapSet::const_iterator iter = provides.begin(); iter != provides.end(); iter++) { - UninstallProcess info ( pool(), context, _item, _upgraded_to, qil, _remove_only, _soft); + for (CapSet::const_iterator iter = provides.begin(); iter != provides.end(); iter++) { + UninstallProcess info ( pool(), context, _item, _upgraded_to, qil, _remove_only, _soft); - //world()->foreachRequiringPoolItem (*iter, uninstall_process_cb, &info); - Dep dep( Dep::REQUIRES ); + //world()->foreachRequiringPoolItem (*iter, uninstall_process_cb, &info); + Dep dep( Dep::REQUIRES ); - invokeOnEach( pool().byCapabilityIndexBegin( iter->index(), dep ), - pool().byCapabilityIndexEnd( iter->index(), dep ), - resfilter::ByCapMatch( *iter ), - functor::functorRef(info) ); + invokeOnEach( pool().byCapabilityIndexBegin( iter->index(), dep ), + pool().byCapabilityIndexEnd( iter->index(), dep ), + resfilter::ByCapMatch( *iter ), + functor::functorRef(info) ); - // re-establish all which supplement or freshen a provides of the just uninstalled item + // re-establish all which supplement or freshen a provides of the just uninstalled item - EstablishItem establish( pool(), qil, _soft ); + EstablishItem establish( pool(), qil, _soft ); - dep = Dep::SUPPLEMENTS; - invokeOnEach( pool().byCapabilityIndexBegin( iter->index(), dep ), - pool().byCapabilityIndexEnd( iter->index(), dep ), - resfilter::ByCapMatch( *iter ), - functor::functorRef( establish ) ); + dep = Dep::SUPPLEMENTS; + invokeOnEach( pool().byCapabilityIndexBegin( iter->index(), dep ), + pool().byCapabilityIndexEnd( iter->index(), dep ), + resfilter::ByCapMatch( *iter ), + functor::functorRef( establish ) ); - dep = Dep::FRESHENS; - invokeOnEach( pool().byCapabilityIndexBegin( iter->index(), dep ), - pool().byCapabilityIndexEnd( iter->index(), dep ), - resfilter::ByCapMatch( *iter ), - functor::functorRef( establish ) ); - } + dep = Dep::FRESHENS; + invokeOnEach( pool().byCapabilityIndexBegin( iter->index(), dep ), + pool().byCapabilityIndexEnd( iter->index(), dep ), + resfilter::ByCapMatch( *iter ), + functor::functorRef( establish ) ); } } diff --git a/zypp/solver/detail/Resolver.cc b/zypp/solver/detail/Resolver.cc index 4d13d5c..5d16b00 100644 --- a/zypp/solver/detail/Resolver.cc +++ b/zypp/solver/detail/Resolver.cc @@ -531,7 +531,15 @@ Resolver::resolveDependencies (const ResolverContext_Ptr context) } for (PoolItemList::const_iterator iter = _items_to_remove.begin(); iter != _items_to_remove.end(); iter++) { - initial_queue->addPoolItemToRemove (*iter, true /* remove-only mode */); + if (!_upgradeMode) + initial_queue->addPoolItemToRemove (*iter, true /* remove-only mode */); + else + // Checking old dependencies for packages which will be updated. + // E.g. foo provides a dependecy which foo-new does not provides anymore. + // So check, if there is a packages installed which requires foo. + // Testcase exercise-bug150844-test.xml + // Testcase Bug156439-test.xml + initial_queue->addPoolItemToRemove (*iter, false /* no remove-only mode */); } for (PoolItemList::const_iterator iter = _items_to_verify.begin(); iter != _items_to_verify.end(); iter++) { diff --git a/zypp/solver/detail/ResolverUpgrade.cc b/zypp/solver/detail/ResolverUpgrade.cc index 04a9c9a..a248c57 100644 --- a/zypp/solver/detail/ResolverUpgrade.cc +++ b/zypp/solver/detail/ResolverUpgrade.cc @@ -637,7 +637,7 @@ MIL << "split matched !" << endl; MIL << opt_stats_r << endl; // Setting Resolver to upgrade mode -// _upgradeMode = true; + _upgradeMode = true; } ///////////////////////////////////////////////////////////////////