[zypp-commit] r7018 - /trunk/libzypp/zypp/solver/detail/QueueItemRequire.cc
Author: schubi2 Date: Thu Aug 30 15:47:19 2007 New Revision: 7018 URL: http://svn.opensuse.org/viewcvs/zypp?rev=7018&view=rev Log: Bugfix: If a requirement has been fulfilled by more than one language resolvables only thatone will be taken which fits to the selected language. 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=7018&r1=7017&r2=7018&view=diff ============================================================================== --- trunk/libzypp/zypp/solver/detail/QueueItemRequire.cc (original) +++ trunk/libzypp/zypp/solver/detail/QueueItemRequire.cc Thu Aug 30 15:47:19 2007 @@ -575,6 +575,7 @@ ZYpp::Ptr z = zypp::getZYpp(); ZYpp::LocaleSet requested_locales = z->getRequestedLocales(); bool requested_locale_match = false; + PoolItem requested_locale_item; PoolItemSet hints; // those which supplement or enhance an installed or to-be-installed for (PoolItemList::iterator it = info.providers.begin(); it != info.providers.end(); ++it) { @@ -585,27 +586,23 @@ if (item.status().staysUninstalled()) { uninstalled++; } - if (!requested_locale_match) { - CapSet freshens( item->dep( Dep::FRESHENS ) ); + CapSet freshens( item->dep( Dep::FRESHENS ) ); - // try to find a match of the locale freshens with one of the requested locales - // if we have a match, we're done. + // try to find a match of the locale freshens with one of the requested locales - for (CapSet::const_iterator cit = freshens.begin(); cit != freshens.end(); ++cit) { - if (cit->refers() == ResTraits<Language>::kind) { - string loc = cit->index(); - MIL << "Look for language fallback " << loc << ":" << item << endl; - if (requested_locales.find( Locale( loc ) ) != requested_locales.end()) { - MIL << "Locale '" << loc << "' is requested, not looking further" << endl; - requested_locale_match = true; - break; - } - language_freshens[loc] = item; + for (CapSet::const_iterator cit = freshens.begin(); cit != freshens.end(); ++cit) { + if (cit->refers() == ResTraits<Language>::kind) { + string loc = cit->index(); + MIL << "Look for language fallback " << loc << ":" << item << endl; + if (requested_locales.find( Locale( loc ) ) != requested_locales.end()) { + MIL << "Locale '" << loc << "' is requested" << endl; + requested_locale_match = true; + requested_locale_item = item; } + language_freshens[loc] = item; } } - // now check if a provider supplements or enhances an installed or to-be-installed resolvable if (hint_match( item->dep( Dep::SUPPLEMENTS ), pool() ) @@ -658,8 +655,28 @@ { MIL << "Have " << hints.size() << " hints" << endl; info.providers.clear(); - for (PoolItemSet::const_iterator it = hints.begin(); it != hints.end(); ++it) - info.providers.push_back( *it ); + for (PoolItemSet::const_iterator it = hints.begin(); it != hints.end(); ++it) { + if (*it == requested_locale_item) { + // This is the requested language item + info.providers.push_back( *it ); + } else { + // go through the list of language items and check if they are exists + std::mapstd::string,PoolItem::const_iterator itFr; + + for (itFr = language_freshens.begin(); itFr != language_freshens.end(); ++itFr) { + if (*it == itFr->second) break; + } + if (itFr == language_freshens.end()) { + // item was only in the supplements --> branch for it + info.providers.push_back( *it ); + } + } + } + if (info.providers.empty()) { + // they are all language items which does not fit in the required language + // So take the firstone to fulfill the requirement. Should never happens + info.providers.push_back( *(hints.begin()) ); + } } else { -- 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