From a3e6aed52db248ae6ac07f183f930564cad9fa33 Mon Sep 17 00:00:00 2001 From: Klaus Kaempf Date: Mon, 27 Feb 2006 11:49:22 +0000 Subject: [PATCH] bugfix 153577, look for best architecture during upgrade --- zypp/solver/detail/Helper.cc | 5 +++-- zypp/solver/detail/ResolverUpgrade.cc | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/zypp/solver/detail/Helper.cc b/zypp/solver/detail/Helper.cc index 4a90ab6..55abcd8 100644 --- a/zypp/solver/detail/Helper.cc +++ b/zypp/solver/detail/Helper.cc @@ -125,7 +125,8 @@ class LookForUpdate : public resfilter::PoolItemFilterFunctor bool operator()( PoolItem_Ref provider ) { if ((!uninstalled // none yet - || uninstalled->edition().compare( provider->edition() ) < 0) // or a better one + || (uninstalled->edition().compare( provider->edition() ) < 0) // or a better edition + || (uninstalled->arch().compare( provider->arch() ) < 0) ) // or a better architecture && !provider.status().isLocked()) // is not locked { uninstalled = provider; // store @@ -147,7 +148,7 @@ Helper::findUpdateItem (const ResPool & pool, PoolItem_Ref item) pool.byNameEnd( item->name() ), functor::chain (functor::chain (resfilter::ByUninstalled (), // ByUninstalled resfilter::ByKind( item->kind() ) ), // equal kind - resfilter::byEdition >( item->edition() )), + resfilter::byEdition >( item->edition() )), // only look at better editions functor::functorRef (info) ); _XDEBUG("Helper::findUpdateItem(" << item << ") => " << info.uninstalled); diff --git a/zypp/solver/detail/ResolverUpgrade.cc b/zypp/solver/detail/ResolverUpgrade.cc index a84130e..0505d49 100644 --- a/zypp/solver/detail/ResolverUpgrade.cc +++ b/zypp/solver/detail/ResolverUpgrade.cc @@ -255,14 +255,14 @@ MIL << "target at " << target << endl; ++opt_stats_r.pre_todel; continue; } - if ( item.status().staysInstalled() ) { + if ( item.status().staysInstalled() ) { // installed item installed = item; CandidateMap::const_iterator cand_it = candidatemap.find(installed); if (cand_it != candidatemap.end()) { - candidate = cand_it->second; + candidate = cand_it->second; // found candidate already } else { - candidate = Helper::findUpdateItem( _pool, installed); + candidate = Helper::findUpdateItem( _pool, installed); // find 'best' upgrade candidate } if (!candidate) { MIL << "doUpgrade available: SKIP no candidate for " << installed << endl; @@ -289,7 +289,8 @@ MIL << "item " << item << " is installed, candidate is " << candidate << endl; MIL << "found installed " << installed << " for item " << candidate << endl; CandidateMap::const_iterator cand_it = candidatemap.find(installed); if (cand_it == candidatemap.end() // not in map yet - || cand_it->second->edition().compare (candidate->edition()) < 0) // or the new is better! + || (cand_it->second->edition().compare (candidate->edition()) < 0) // or the new has better edition + || (cand_it->second->arch().compare (candidate->arch()) < 0) ) // or the new has better architecture { candidatemap[installed] = candidate; // put it in ! } -- 2.7.4