{
// 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