[yum/f14: 1/2] 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:06:43 UTC 2011
commit 5983bf4fc3c8bc11e142f505d5c3478abb1898c3
Author: James Antill <james at and.org>
Date: Wed May 11 11:03:15 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 | 147 +++++++++++++++++++++++++++++++++++++++++
yum.spec | 9 +++
3 files changed, 234 insertions(+), 0 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..0e99028
--- /dev/null
+++ b/skip-broken-rel-eng.patch
@@ -0,0 +1,147 @@
+commit 35d04e27d65dc87f293c10bf4b90d8988f5170a0
+Author: Tim Lauridsen <timlau at fedoraproject.org>
+Date: Fri Nov 5 08:08:28 2010 +0100
+
+ - Make downgrade testcase
+ - fix test DepsolveProgressCallback to handle downgrade
+ - fix skip-broken code to handle downgrades
+ - prefix all skipbroken debug message with 'SKIPBROKEN:' for easier filtering
+
+diff --git a/yum/__init__.py b/yum/__init__.py
+index 234b599..11e019a 100644
+--- a/yum/__init__.py
++++ b/yum/__init__.py
+@@ -1057,7 +1057,7 @@ class YumBase(depsolve.Depsolve):
+ # and skip-broken shouldn't care too much about speed.
+ self.rpmdb.transactionReset()
+ self.installedFileRequires = None # Kind of hacky
+- self.verbose_logger.debug(_("Skip-broken round %i"), count)
++ self.verbose_logger.debug("SKIPBROKEN: ########### Round %i ################" , count)
+ self._printTransaction()
+ depTree = self._buildDepTree()
+ startTs = set(self.tsInfo)
+@@ -1114,7 +1114,7 @@ class YumBase(depsolve.Depsolve):
+ self._checkUpdatedLeftovers() # Cleanup updated leftovers
+ rescode, restring = self.resolveDeps()
+ if rescode != 1:
+- self.verbose_logger.debug(_("Skip-broken took %i rounds "), count)
++ self.verbose_logger.debug("SKIPBROKEN: took %i rounds ", count)
+ self.verbose_logger.info(_('\nPackages skipped because of dependency problems:'))
+ skipped_list = [p for p in skipped_po]
+ skipped_list.sort()
+@@ -1228,14 +1228,14 @@ class YumBase(depsolve.Depsolve):
+ TS_AVAILABLE : "available",
+ TS_UPDATED : "updated"}
+
+- self.verbose_logger.log(logginglevels.DEBUG_2,"TSINFO: Current Transaction : %i member(s) " % len(self.tsInfo))
++ self.verbose_logger.log(logginglevels.DEBUG_2,"SKIPBROKEN: Current Transaction : %i member(s) " % len(self.tsInfo))
+ for txmbr in sorted(self.tsInfo):
+- msg = " %-11s : %s " % (state[txmbr.output_state],txmbr.po)
++ msg = "SKIPBROKEN: %-11s : %s " % (state[txmbr.output_state],txmbr.po)
+ self.verbose_logger.log(logginglevels.DEBUG_2, msg)
+ for po,rel in sorted(txmbr.relatedto):
+- msg = " %s : %s" % (rel,po)
++ msg = "SKIPBROKEN: %s : %s" % (rel,po)
+ self.verbose_logger.log(logginglevels.DEBUG_2, msg)
+-
++ self.verbose_logger.log(logginglevels.DEBUG_2,"SKIPBROKEN:%s" % (60 * "="))
+
+ def _getPackagesToRemove(self,po,deptree,toRemove):
+ '''
+@@ -1246,6 +1246,10 @@ class YumBase(depsolve.Depsolve):
+ for pkg in (txmbr.updates + txmbr.obsoletes):
+ toRemove.add(pkg)
+ self._getDepsToRemove(pkg, deptree, toRemove)
++ # Remove related packages
++ for (relative, relation) in txmbr.relatedto:
++ toRemove.add(relative)
++ self._getDepsToRemove(relative, deptree, toRemove)
+ self._getDepsToRemove(po, deptree, toRemove)
+
+ def _getDepsToRemove(self,po, deptree, toRemove):
+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/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/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 406278f..5bd77c3 100644
--- a/yum.spec
+++ b/yum.spec
@@ -17,6 +17,9 @@ Patch5: geode-arch.patch
Patch6: yum-HEAD.patch
Patch7: yum-PK-auto-close-fix.patch
+Patch8: skip-broken-rel-eng.patch
+Patch9: BZ-701744-collapse-libc.patch
+
Patch20: yum-manpage-files.patch
URL: http://yum.baseurl.org/
@@ -73,6 +76,8 @@ can notify you when they are available via email, syslog or dbus.
%patch5 -p1
%patch6 -p1
%patch7 -p1
+%patch8 -p1
+%patch9 -p1
%patch20 -p1
%build
@@ -136,6 +141,10 @@ rm -rf $RPM_BUILD_ROOT
%dir /usr/lib/yum-plugins
%changelog
+* Wed May 11 2011 James Antill <james at fedoraproject.org> - 3.2.28-5
+- Update consolidate_libc to fix new version issue.
+- Limit skip-broken to 30 loops, for rel-eng.
+
* Tue Sep 14 2010 James Antill <james at fedoraproject.org> - 3.2.28-4
- Fix auto-close bug with GPG key installs.
- Resolves: bug#622179
More information about the scm-commits
mailing list