Imported Upstream version 14.42.3 44/94644/1
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 1 Nov 2016 01:36:04 +0000 (10:36 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 1 Nov 2016 01:36:05 +0000 (10:36 +0900)
Change-Id: I12be961cc862ed4af11b5c2c4f8ccaa76a675dae
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
VERSION.cmake
package/libzypp.changes
zypp/PoolItem.cc
zypp/Product.cc

index 8304346..901f1c2 100644 (file)
@@ -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)
 #=======
index 8ad414f..e8a2384 100644 (file)
@@ -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)
index 3f9e633..44aae33 100644 (file)
@@ -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;
index 75def80..d66d6c3 100644 (file)
@@ -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;
       }
     }