[yum/f15] Update consolidate_libc to fix new version issue. Limit skip-broken to 30 loops, for rel-eng.

James Antill james at fedoraproject.org
Wed May 11 15:11:07 UTC 2011


commit 370664a6224949e9cd57ba7850cf042134cc85e1
Author: James Antill <james at and.org>
Date:   Wed May 11 11:10:46 2011 -0400

    Update consolidate_libc to fix new version issue.
    Limit skip-broken to 30 loops, for rel-eng.

 BZ-701744-collapse-libc.patch |   78 ++++++++++++
 skip-broken-rel-eng.patch     |  262 +++++++++++++++++++++++++++++++++++++++++
 yum.spec                      |   11 ++-
 3 files changed, 350 insertions(+), 1 deletions(-)
---
diff --git a/BZ-701744-collapse-libc.patch b/BZ-701744-collapse-libc.patch
new file mode 100644
index 0000000..b149c45
--- /dev/null
+++ b/BZ-701744-collapse-libc.patch
@@ -0,0 +1,78 @@
+commit 043e869b08126c1b24e392f809c9f6871344c60d
+Author: Seth Vidal <skvidal at fedoraproject.org>
+Date:   Wed May 4 09:43:52 2011 -0400
+
+    make sure we use rpm ver cmp for the sort of the glibc requires
+    
+    when we're doing  collapse_libc_requires.
+    ultimately what's causing: https://bugzilla.redhat.com/show_bug.cgi?id=701744
+
+diff --git a/rpmUtils/miscutils.py b/rpmUtils/miscutils.py
+index cdb1cb6..aea4550 100644
+--- a/rpmUtils/miscutils.py
++++ b/rpmUtils/miscutils.py
+@@ -54,6 +54,10 @@ def compareEVR((e1, v1, r1), (e2, v2, r2)):
+     #print '%s, %s, %s vs %s, %s, %s = %s' % (e1, v1, r1, e2, v2, r2, rc)
+     return rc
+ 
++def compareVerOnly(v1, v2):
++    """compare version strings only using rpm vercmp"""
++    return compareEVR(('', v1, ''), ('', v2, ''))
++    
+ def checkSig(ts, package):
+     """Takes a transaction set and a package, check it's sigs, 
+     return 0 if they are all fine
+diff --git a/yum/packages.py b/yum/packages.py
+index 264aa9a..e745a1a 100644
+--- a/yum/packages.py
++++ b/yum/packages.py
+@@ -31,11 +31,12 @@ import warnings
+ from subprocess import Popen, PIPE
+ from rpmUtils import RpmUtilsError
+ import rpmUtils.miscutils
+-from rpmUtils.miscutils import flagToString, stringToVersion
++from rpmUtils.miscutils import flagToString, stringToVersion, compareVerOnly
+ import Errors
+ import errno
+ import struct
+ from constants import *
++from operator import itemgetter
+ 
+ import urlparse
+ urlparse.uses_fragment.append("media")
+@@ -1139,7 +1140,11 @@ class YumAvailablePackage(PackageObject, RpmBase):
+         if hasattr(self, '_collapse_libc_requires') and self._collapse_libc_requires:
+             libc_requires = filter(lambda x: x[0].startswith('libc.so.6'), mylist)
+             if libc_requires:
+-                best = sorted(libc_requires)[-1]
++                print libc_requires
++                rest = sorted(libc_requires, cmp=compareVerOnly, key=itemgetter(0))
++                best = rest.pop()
++                if best[0].startswith('libc.so.6()'):
++                    best = rest.pop()
+                 newlist = []
+                 for i in mylist:
+                     if i[0].startswith('libc.so.6') and i != best:
+commit 6bf7ca012bfb3d674df3f196f2f9e3eaabef0c91
+Author: Seth Vidal <skvidal at fedoraproject.org>
+Date:   Wed May 4 10:21:55 2011 -0400
+
+    remove a debug print
+    add an explanation of why we skip libc.so.6()
+
+diff --git a/yum/packages.py b/yum/packages.py
+index e745a1a..95c50a1 100644
+--- a/yum/packages.py
++++ b/yum/packages.py
+@@ -1140,10 +1140,9 @@ class YumAvailablePackage(PackageObject, RpmBase):
+         if hasattr(self, '_collapse_libc_requires') and self._collapse_libc_requires:
+             libc_requires = filter(lambda x: x[0].startswith('libc.so.6'), mylist)
+             if libc_requires:
+-                print libc_requires
+                 rest = sorted(libc_requires, cmp=compareVerOnly, key=itemgetter(0))
+                 best = rest.pop()
+-                if best[0].startswith('libc.so.6()'):
++                if best[0].startswith('libc.so.6()'): # rpmvercmp will sort this one as 'highest' so we need to remove it from the list
+                     best = rest.pop()
+                 newlist = []
+                 for i in mylist:
diff --git a/skip-broken-rel-eng.patch b/skip-broken-rel-eng.patch
new file mode 100644
index 0000000..f2367a1
--- /dev/null
+++ b/skip-broken-rel-eng.patch
@@ -0,0 +1,262 @@
+commit eeadab5beb419c6e884f30c04fda58ed1d05b538
+Author: Tim Lauridsen <timlau at fedoraproject.org>
+Date:   Sat Mar 5 13:55:09 2011 +0100
+
+    Add a unit test to make skip-broken go into endless loop when an installed
+    package conflict with an update.
+    Fix the cause by in depsolve by putting the conflicting po into the problem
+    tuple, so skip-broken knows what to remove from the transaction.
+    Also show the full package in the conflict message and not just the name.
+
+diff --git a/test/skipbroken-tests.py b/test/skipbroken-tests.py
+index 31482bc..36a4a6d 100644
+--- a/test/skipbroken-tests.py
++++ b/test/skipbroken-tests.py
+@@ -1,8 +1,11 @@
+ import unittest
+ import logging
+ import sys
++import re
+ from testbase import *
+ 
++REGEX_PKG = re.compile(r"(\d*):?(.*)-(.*)-(.*)\.(.*)$")
++
+ class SkipBrokenTests(DepsolveTests):
+     ''' Test cases to test skip-broken'''
+     
+@@ -20,6 +23,36 @@ class SkipBrokenTests(DepsolveTests):
+         po = FakePackage(name, version, release, epoch, arch, repo=self.repo)
+         self.rpmdb.addPackage(po)
+         return po
++
++    def _pkgstr_to_nevra(self, pkg_str):
++        '''
++        Get a nevra from from a epoch:name-version-release.arch string
++        @param pkg_str: package string
++        '''
++        res = REGEX_PKG.search(pkg_str)
++        if res:
++            (e,n,v,r,a) = res.groups()
++            if e == "": 
++                e = "0"
++            return (n,e,v,r,a)   
++        else: 
++            raise AttributeError("Illegal package string : %s" % pkg_str)
++
++    def repoString(self, pkg_str):
++        ''' 
++        Add an available package from a epoch:name-version-release.arch string
++        '''
++        (n,e,v,r,a) = self._pkgstr_to_nevra(pkg_str)
++        return self.repoPackage(n,v,r,e,a)   
++                
++            
++    def instString(self, pkg_str):
++        ''' 
++        Add an installed package from a epoch:name-version-release.arch string
++        '''
++        (n,e,v,r,a) = self._pkgstr_to_nevra(pkg_str)
++        return self.instPackage(n,v,r,e,a)   
++
+            
+     def testMissingReqNoSkip(self):
+         ''' install fails,  because of missing req.
+@@ -671,6 +704,35 @@ class SkipBrokenTests(DepsolveTests):
+         # uncomment this line and the test will fail and you can see the output
+         # self.assertResult([i1])
+         
++    def test_conflict_looping(self):
++        ''' 
++        Skip-broken is looping
++        https://bugzilla.redhat.com/show_bug.cgi?id=681806
++        '''
++        members = [] # the result after the transaction
++        # Installed package conflicts with u1
++        i0 = self.instString('kde-l10n-4.6.0-3.fc15.1.noarch')
++        i0.addConflicts('kdepim', 'GT', ('6', '4.5.9', '0'))
++        members.append(i0)
++        i1 = self.instString('6:kdepim-4.5.94.1-1.fc14.x86_64')
++        u1 = self.repoString('7:kdepim-4.4.10-1.fc15.x86_64')
++        self.tsInfo.addUpdate(u1, oldpo=i1)
++        # u1 should be removed, because of the conflict
++        members.append(i1)
++        i2 = self.instString('6:kdepim-libs-4.5.94.1-1.fc14.x86_64')
++        u2 = self.repoString('7:kdepim-libs-4.4.10-1.fc15.x86_64')
++        self.tsInfo.addUpdate(u2, oldpo=i2)
++        members.append(u2)
++        i3 = self.instString('kdepim-runtime-libs-4.5.94.1-2.fc14.x86_64')
++        u3 = self.repoString('1:kdepim-runtime-libs-4.4.10-2.fc15.x86_64')
++        self.tsInfo.addUpdate(u3, oldpo=i3)
++        members.append(u3)
++        i4 = self.instString('kdepim-runtime-4.5.94.1-2.fc14.x86_64')
++        u4 = self.repoString('1:kdepim-runtime-4.4.10-2.fc15.x86_64')
++        self.tsInfo.addUpdate(u4, oldpo=i4)
++        members.append(u4)
++        self.assertEquals('ok', *self.resolveCode(skip=True))
++        self.assertResult(members)
+     
+     
+     def resolveCode(self,skip = False):
+diff --git a/yum/depsolve.py b/yum/depsolve.py
+index 8f18ccc..388811d 100644
+--- a/yum/depsolve.py
++++ b/yum/depsolve.py
+@@ -680,11 +680,12 @@ class Depsolve(object):
+         if len(self.tsInfo) != length and txmbrs:
+             return CheckDeps, errormsgs
+ 
+-        msg = '%s conflicts with %s' % (name, conflicting_po.name)
++        msg = '%s conflicts with %s' % (name, str(conflicting_po))
+         errormsgs.append(msg)
+         self.verbose_logger.log(logginglevels.DEBUG_1, msg)
+         CheckDeps = False
+-        self.po_with_problems.add((po,None,errormsgs[-1]))
++        # report the conflicting po, so skip-broken can remove it
++        self.po_with_problems.add((po,conflicting_po,errormsgs[-1]))
+         return CheckDeps, errormsgs
+ 
+     def _undoDepInstalls(self):
+commit e07978f754d4268ce7637af036fc0bde9f16c0b4
+Author: Tim Lauridsen <timlau at fedoraproject.org>
+Date:   Thu Mar 31 10:20:58 2011 +0200
+
+    Fix bugs in the skip-broken code, this should fix some of the weird cases where skip-broken fails today
+
+diff --git a/test/skipbroken-tests.py b/test/skipbroken-tests.py
+index 36a4a6d..812785a 100644
+--- a/test/skipbroken-tests.py
++++ b/test/skipbroken-tests.py
+@@ -733,6 +733,82 @@ class SkipBrokenTests(DepsolveTests):
+         members.append(u4)
+         self.assertEquals('ok', *self.resolveCode(skip=True))
+         self.assertResult(members)
++
++    def test_skipbroken_001(self):
++        ''' 
++        this will pass
++        https://bugzilla.redhat.com/show_bug.cgi?id=656057
++        '''
++        members = []
++        # Installed package conflicts with ux1
++        ix0 = self.instString('1:libguestfs-1.6.0-1.fc14.1.i686')
++        ix0.addRequires('/usr/lib/.libssl.so.1.0.0a.hmac')
++        members.append(ix0)
++        ix1 = self.instString('openssl-1.0.0a-2.fc14.i686')
++        ix1.addFile("/usr/lib/.libssl.so.1.0.0a.hmac")
++        ux1 = self.repoString('openssl-1.0.0b-1.fc14.i686')
++        ux1.addFile("/usr/lib/.libssl.so.1.0.0b.hmac")
++        self.tsInfo.addUpdate(ux1, oldpo=ix1)
++        members.append(ix1)
++        self.assertEquals('empty', *self.resolveCode(skip=True))
++        self.assertResult(members)
++
++
++    def test_skipbroken_002(self):
++        ''' 
++        this will pass
++        https://bugzilla.redhat.com/show_bug.cgi?id=656057
++        '''
++        members = []
++        # Installed package conflicts with ux1
++        ix0 = self.instString('1:libguestfs-1.6.0-1.fc14.1.i686')
++        ix0.addRequires('/usr/lib/.libssl.so.1.0.0a.hmac')
++        members.append(ix0)
++        ix1 = self.instString('openssl-1.0.0a-2.fc14.i686')
++        ix1.addFile("/usr/lib/.libssl.so.1.0.0a.hmac")
++        ux1 = self.repoString('openssl-1.0.0b-1.fc14.i686')
++        ux1.addFile("/usr/lib/.libssl.so.1.0.0b.hmac")
++        self.tsInfo.addUpdate(ux1, oldpo=ix1)
++        members.append(ix1)
++        # this is just junk to make the transaction big
++        i1 = self.instString('afoobar-0.4.12-2.fc12.noarch')
++        u1 = self.repoString('afoobar-0.4.14-1.fc14.noarch')
++        self.tsInfo.addUpdate(u1, oldpo=i1)
++        members.append(u1)
++        self.assertEquals('ok', *self.resolveCode(skip=True))
++        self.assertResult(members)
++
++    def test_skipbroken_003(self):
++        ''' 
++        this will fail, because of a bug in the skip-broken code.
++        it will remove the wrong package (zfoobar) instead of openssl.
++        the problem is that self._working_po is not set with the right value
++        when checking file requires for installed packages after the transaction
++        if resolved. (_resolveRequires)
++        if fails because self._working_po contains the last package processed in the transaction
++        zfoobar, so it will be removed.
++        https://bugzilla.redhat.com/show_bug.cgi?id=656057
++        
++        This should not fail anymore, after the the self._working_po is reset in depsolver
++        '''
++        members = []
++        # Installed package conflicts with ux1
++        ix0 = self.instString('1:libguestfs-1.6.0-1.fc14.1.i686')
++        ix0.addRequires('/usr/lib/.libssl.so.1.0.0a.hmac')
++        members.append(ix0)
++        ix1 = self.instString('openssl-1.0.0a-2.fc14.i686')
++        ix1.addFile("/usr/lib/.libssl.so.1.0.0a.hmac")
++        ux1 = self.repoString('openssl-1.0.0b-1.fc14.i686')
++        ux1.addFile("/usr/lib/.libssl.so.1.0.0b.hmac")
++        self.tsInfo.addUpdate(ux1, oldpo=ix1)
++        members.append(ix1)
++        # this is just junk to make the transaction big
++        i1 = self.instString('zfoobar-0.4.12-2.fc12.noarch')
++        u1 = self.repoString('zfoobar-0.4.14-1.fc14.noarch')
++        self.tsInfo.addUpdate(u1, oldpo=i1)
++        members.append(u1)
++        self.assertEquals('ok', *self.resolveCode(skip=True))
++        self.assertResult(members)
+     
+     
+     def resolveCode(self,skip = False):
+diff --git a/yum/__init__.py b/yum/__init__.py
+index 60c572d..cf4d827 100644
+--- a/yum/__init__.py
++++ b/yum/__init__.py
+@@ -1125,6 +1125,9 @@ class YumBase(depsolve.Depsolve):
+             self.rpmdb.transactionReset()
+             self.installedFileRequires = None # Kind of hacky
+             self.verbose_logger.debug("SKIPBROKEN: ########### Round %i ################" , count)
++            if count == 30: # Failsafe, to avoid endless looping
++                self.verbose_logger.debug('SKIPBROKEN: Too many loops ')
++                break
+             self._printTransaction()        
+             depTree = self._buildDepTree()
+             startTs = set(self.tsInfo)
+@@ -1140,7 +1143,7 @@ class YumBase(depsolve.Depsolve):
+                 for skip in skipped:
+                     skipped_po.add(skip)
+                     # make sure we get the compat arch packages skip from pkgSack and up too.
+-                    if skip not in removed_from_sack and skip.repoid == 'installed':
++                    if skip not in removed_from_sack and skip.repoid != 'installed':
+                         _remove_from_sack(skip)
+             # Nothing was removed, so we still got a problem
+              # the first time we get here we reset the resolved members of
+diff --git a/yum/depsolve.py b/yum/depsolve.py
+index 388811d..44ccfd7 100644
+--- a/yum/depsolve.py
++++ b/yum/depsolve.py
+@@ -350,6 +350,7 @@ class Depsolve(object):
+             providers = self.rpmdb.getProvides(needname, needflags, needversion)
+ 
+         for inst_po in providers:
++            self._working_po = inst_po # store the last provider
+             inst_str = '%s.%s %s:%s-%s' % inst_po.pkgtup
+             (i_n, i_a, i_e, i_v, i_r) = inst_po.pkgtup
+             self.verbose_logger.log(logginglevels.DEBUG_2,
+@@ -753,6 +754,7 @@ class Depsolve(object):
+ 
+ 
+             # check global FileRequires
++            self._working_po = None # reset the working po
+             if CheckRemoves:
+                 CheckRemoves = False
+                 for po, dep in self._checkFileRequires():
+@@ -766,6 +768,7 @@ class Depsolve(object):
+                     continue
+ 
+             # check Conflicts
++            self._working_po = None # reset the working po
+             if CheckInstalls:
+                 CheckInstalls = False
+                 for conflict in self._checkConflicts():
diff --git a/yum.spec b/yum.spec
index e24b696..bb76bf7 100644
--- a/yum.spec
+++ b/yum.spec
@@ -7,7 +7,7 @@
 Summary: RPM package installer/updater/manager
 Name: yum
 Version: 3.2.29
-Release: 4%{?dist}
+Release: 5%{?dist}
 License: GPLv2+
 Group: System Environment/Base
 Source0: http://yum.baseurl.org/download/3.2/%{name}-%{version}.tar.gz
@@ -20,6 +20,9 @@ Patch4: no-more-exactarchlist.patch
 Patch5: geode-arch.patch
 Patch6: yum-HEAD.patch
 
+Patch8: skip-broken-rel-eng.patch
+Patch9: BZ-701744-collapse-libc.patch
+
 Patch20: yum-manpage-files.patch
 
 URL: http://yum.baseurl.org/
@@ -124,6 +127,8 @@ Install this package if you want auto yum updates nightly via cron.
 %patch4 -p0
 %patch5 -p1
 %patch6 -p1
+%patch8 -p1
+%patch9 -p1
 %patch20 -p1
 
 %build
@@ -247,6 +252,10 @@ exit 0
 %config(noreplace) %{_sysconfdir}/sysconfig/yum-cron
 
 %changelog
+* Wed May 11 2011 James Antill <james at fedoraproject.org> - 3.2.29-5
+- Update consolidate_libc to fix new version issue.
+- Limit skip-broken to 30 loops, for rel-eng.
+
 * Tue Feb 08 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 3.2.29-4
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
 


More information about the scm-commits mailing list