ref: refs/heads/SuSE-Code-11-Branch
commit 697e6a6136cb82268b4e1aff9eb2b8962b1927f0
Author: Michael Andres
Date: Tue Sep 22 21:03:40 2009 +0200
Take vendor into account when computing the Selectables default candidate.
---
zypp/ui/SelectableImpl.h | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/zypp/ui/SelectableImpl.h b/zypp/ui/SelectableImpl.h
index 7662acc..bfd3584 100644
--- a/zypp/ui/SelectableImpl.h
+++ b/zypp/ui/SelectableImpl.h
@@ -246,14 +246,20 @@ namespace zypp
for ( installed_const_iterator iit = installedBegin();
iit != installedEnd(); ++iit )
{
+ PoolItem sameArch; // in case there's no same vendor at least stay with same arch
for ( available_const_iterator it = availableBegin();
it != availableEnd(); ++it )
{
if ( (*iit)->arch() == (*it)->arch() )
{
- return (*it);
+ if ( VendorAttr::instance().equivalent( (*iit), (*it) ) )
+ return *it;
+ else if ( ! sameArch ) // remember best same arch in case no same vendor found
+ sameArch = *it;
}
}
+ if ( sameArch )
+ return sameArch;
}
}
if ( _availableItems.empty() )
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org