From 8af43e8e9fb20455b7cbc41b1c47669739d67ffb Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Tue, 1 Nov 2016 10:36:04 +0900 Subject: [PATCH] Imported Upstream version 14.42.3 Change-Id: I12be961cc862ed4af11b5c2c4f8ccaa76a675dae 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 8304346..901f1c2 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -61,8 +61,8 @@ SET(LIBZYPP_MAJOR "14") SET(LIBZYPP_COMPATMINOR "39") SET(LIBZYPP_MINOR "42") -SET(LIBZYPP_PATCH "2") +SET(LIBZYPP_PATCH "3") # -# LAST RELEASED: 14.42.2 (39) +# LAST RELEASED: 14.42.3 (39) # (The number in parenthesis is LIBZYPP_COMPATMINOR) #======= diff --git a/package/libzypp.changes b/package/libzypp.changes index 8ad414f..e8a2384 100644 --- a/package/libzypp.changes +++ b/package/libzypp.changes @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Fri Oct 23 17:15:37 CEST 2015 - ma@suse.de + +- Fix broken product: <-> -release package relation (bnc#951782) +- version 14.42.3 (39) + +------------------------------------------------------------------- Thu Oct 22 10:27:41 CEST 2015 - ma@suse.de - fix Plugin-services not updating repo GPGCheck settings (bnc#951402) diff --git a/zypp/PoolItem.cc b/zypp/PoolItem.cc index 3f9e633..44aae33 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