ref: refs/heads/master
commit 1271b82c0ea6f2358d7707187872a27d386cdf43
Author: Michael Andres
Date: Mon Apr 27 15:36:46 2009 +0200
Link a product buddy to the latest release package version (bnc #497696).
---
zypp/Product.cc | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/zypp/Product.cc b/zypp/Product.cc
index 32f93a7..50b9d54 100644
--- a/zypp/Product.cc
+++ b/zypp/Product.cc
@@ -77,18 +77,26 @@ namespace zypp
{
// Look for a provider of 'product(name) = version' of same
// architecture and within the same repo.
+ //
+ // bnc #497696: Update repos may have multiple release package versions
+ // providing the same product. As a workaround we link to the one with
+ // the highest version.
Capability identCap( str::form( "product(%s) = %s", name().c_str(), edition().c_str() ) );
+ sat::Solvable found;
sat::WhatProvides providers( identCap );
for_( it, providers.begin(), providers.end() )
{
if ( it->repository() == repository()
&& it->arch() == arch() )
- return *it;
+ {
+ if ( ! found || found.edition() < it->edition() )
+ found = *it;
+ }
}
-
- WAR << *this << ": no reference package found: " << identCap << endl;
- return sat::Solvable::noSolvable;
+ if ( ! found )
+ WAR << *this << ": no reference package found: " << identCap << endl;
+ return found;
}
std::string Product::referenceFilename() const
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org