From 6efecaba1306877fc1b87c320457654b63b1d68c Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Tue, 1 Nov 2016 11:07:18 +0900 Subject: [PATCH] Imported Upstream version 15.19.5 Change-Id: I652269d479888d4173881bb3346dda939d2aac2b Signed-off-by: DongHun Kwak --- VERSION.cmake | 4 ++-- package/libzypp.changes | 6 ++++++ zypp/PoolItem.cc | 5 +++++ zypp/Product.cc | 23 ++++++++++++++++------- 4 files changed, 29 insertions(+), 9 deletions(-) diff --git a/VERSION.cmake b/VERSION.cmake index 9434300..484616e 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -61,8 +61,8 @@ SET(LIBZYPP_MAJOR "15") SET(LIBZYPP_COMPATMINOR "19") SET(LIBZYPP_MINOR "19") -SET(LIBZYPP_PATCH "4") +SET(LIBZYPP_PATCH "5") # -# LAST RELEASED: 15.19.4 (19) +# LAST RELEASED: 15.19.5 (19) # (The number in parenthesis is LIBZYPP_COMPATMINOR) #======= diff --git a/package/libzypp.changes b/package/libzypp.changes index fc3d908..4ba32e7 100644 --- a/package/libzypp.changes +++ b/package/libzypp.changes @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Fri Oct 23 17:10:18 CEST 2015 - ma@suse.de + +- Fix broken product: <-> -release package relation (bnc#951782) +- version 15.19.5 (19) + +------------------------------------------------------------------- Thu Oct 22 12:23:29 CEST 2015 - ma@suse.de - Use a uniform translation set for SLE and openSUSE (bnc#948924) diff --git a/zypp/PoolItem.cc b/zypp/PoolItem.cc index 89f6dfd..b5dad75 100644 --- a/zypp/PoolItem.cc +++ b/zypp/PoolItem.cc @@ -158,6 +158,11 @@ namespace zypp PoolItem myBuddy( solv_r ); if ( myBuddy ) { + if ( myBuddy._pimpl->_buddy ) + { + ERR << *this << " would be buddy2 in " << myBuddy << endl; + return; + } myBuddy._pimpl->_buddy = -resolvable()->satSolvable().id(); _buddy = myBuddy.satSolvable().id(); DBG << *this << " has buddy " << myBuddy << endl; diff --git a/zypp/Product.cc b/zypp/Product.cc index 75def80..d66d6c3 100644 --- a/zypp/Product.cc +++ b/zypp/Product.cc @@ -79,20 +79,29 @@ 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. + // Code12: Update repos may have multiple release package versions + // providing the same product. Prefer the one matching the buildtime, + // as the product buildtime is derived from the -release package. Capability identCap( str::form( "product(%s) = %s", name().c_str(), edition().c_str() ) ); sat::Solvable found; + bool foundBuildTime = false; sat::WhatProvides providers( identCap ); for_( it, providers.begin(), providers.end() ) { - if ( it->repository() == repository() - && it->arch() == arch() ) + if ( it->repository() == repository() && it->arch() == arch() ) { - if ( ! found || found.edition() < it->edition() ) - found = *it; + bool fitsBuildtime = ( it->buildtime() == buildtime() ); + if ( found ) + { + bool lowerEdition = ( it->edition() <= found.edition() ); + if ( ( foundBuildTime && ( !fitsBuildtime || lowerEdition ) ) + || ( !foundBuildTime && ( !fitsBuildtime && lowerEdition ) ) ) + continue; + } + found = *it; + if ( fitsBuildtime ) + foundBuildTime = true; } } -- 2.7.4