[zypp-commit] r7339 - /trunk/libzypp/zypp/solver/detail/QueueItemRequire.cc
Author: schubi2 Date: Mon Sep 24 15:48:01 2007 New Revision: 7339 URL: http://svn.opensuse.org/viewcvs/zypp?rev=7339&view=rev Log: If more than one resolvables provide a requirements and have different architecture take thatone with the best architecture. (Not regarding the name) Modified: trunk/libzypp/zypp/solver/detail/QueueItemRequire.cc Modified: trunk/libzypp/zypp/solver/detail/QueueItemRequire.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/QueueItemRequire.cc?rev=7339&r1=7338&r2=7339&view=diff ============================================================================== --- trunk/libzypp/zypp/solver/detail/QueueItemRequire.cc (original) +++ trunk/libzypp/zypp/solver/detail/QueueItemRequire.cc Mon Sep 24 15:48:01 2007 @@ -541,6 +541,29 @@ _XDEBUG("Look for providers of " << _capability); + if (!context->tryAllPossibilities()) { + // If there is one item with the better architecture than the others-->take it + PoolItem_Ref bestItem = PoolItem_Ref(); + PoolItemList::iterator it; + for (it = info.providers.begin(); + it != info.providers.end(); it++) { + if (bestItem == PoolItem_Ref()) { + bestItem = *it; + } else if (bestItem->arch().compare( (*it)->arch() ) < 0) { // better arch + _XDEBUG("Taking only one provider with the best architecture --> ignoring e.g. " << bestItem); + bestItem = *it; + break; + } + } + if (it != info.providers.end()) { + // found one with better architecture --> take it; + info.providers.clear(); + info.providers.push_front(bestItem); + context->setSkippedPossibilities( true ); // Flag that there are other possibilities + _XDEBUG("Taking only one provider with the best architecture: " << bestItem); + } + } + num_providers = info.providers.size(); _XDEBUG( "requirement is met by " << num_providers << " resolvable"); -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org
participants (1)
-
schubi2@svn.opensuse.org