[yum-commits] Branch 'yum-3_2_X' - 2 commits - test/skipbroken-tests.py yum/__init__.py
Tim Lauridsen
timlau at osuosl.org
Wed Sep 16 17:21:04 UTC 2009
test/skipbroken-tests.py | 18 ++++++++++++++++++
yum/__init__.py | 16 ++++++++++++++++
2 files changed, 34 insertions(+)
New commits:
commit d569b4efd2f8aed9786b85174dfc4b4fdc722e5f
Merge: 7b0868b... 6fd122d...
Author: Tim Lauridsen <timlau at fedoraproject.org>
Date: Wed Sep 16 19:20:49 2009 +0200
Merge branch 'yum-3_2_X' of ssh://yum.baseurl.org/srv/projects/yum/git/yum into yum-3_2_X
commit 7b0868bfcacb950266753301b551eca8bc5366ee
Author: Tim Lauridsen <timlau at fedoraproject.org>
Date: Wed Sep 16 19:00:48 2009 +0200
Make skip broken handle cases where pkg dupes are installed
and an update updates both of them but has dep problems.
Make sure we get all the TS_UPDATED members cleaned from the
transaction.
https://bugzilla.redhat.com/show_bug.cgi?id=522112
diff --git a/test/skipbroken-tests.py b/test/skipbroken-tests.py
index db71a21..f8896f1 100644
--- a/test/skipbroken-tests.py
+++ b/test/skipbroken-tests.py
@@ -582,6 +582,24 @@ class SkipBrokenTests(DepsolveTests):
self.assertEquals('empty', *self.resolveCode(skip=True))
self.assertResult([c1,d1,r1,r2,r3,r4])
+ def testDualPackageUpdate(self):
+ '''
+ RHBZ #522112
+ two version of the same package installed on the system
+ and update will update both, but if it fail some dep only
+ One of the updated packages will be removed from the
+ transaction.
+ '''
+ i1 = self.instPackage('xorg-x11-server-Xorg','1.6.99.900')
+ i2 = self.instPackage('xorg-x11-server-Xorg','1.6.3')
+ u1 = self.repoPackage('xorg-x11-server-Xorg', '1.6.99.901')
+ u1.addRequires("notfound")
+ self.tsInfo.addUpdate(u1, oldpo=i1)
+ self.tsInfo.addUpdate(u1, oldpo=i2)
+ self.assertEquals('empty', *self.resolveCode(skip=True))
+ self.assertResult([i1,i2])
+
+
def resolveCode(self,skip = False):
solver = YumBase()
diff --git a/yum/__init__.py b/yum/__init__.py
index d13f7a9..6c27f50 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -879,6 +879,7 @@ class YumBase(depsolve.Depsolve):
self.verbose_logger.debug('SKIPBROKEN: sanity check the current transaction' )
self.tsInfo.resetResolved(hard=True)
self._checkMissingObsoleted() # This is totally insane, but needed :(
+ self._checkUpdatedLeftovers() # Cleanup updated leftovers
rescode, restring = self.resolveDeps()
if rescode != 1:
self.verbose_logger.debug(_("Skip-broken took %i rounds "), count)
@@ -914,6 +915,21 @@ class YumBase(depsolve.Depsolve):
self.verbose_logger.debug('SKIPBROKEN: Remove extra obsoleted %s (%s)' % (txmbr.po,pkg) )
self.tsInfo.remove(txmbr.po.pkgtup)
+ def _checkUpdatedLeftovers(self):
+ """
+ If multiple packages is updated the same package
+ and this package get removed because of an dep issue
+ then make sure that all the TS_UPDATED get removed.
+ """
+ for txmbr in self.tsInfo.getMembersWithState(None, [TS_UPDATED]):
+ for pkg in txmbr.updated_by:
+ # check if the updating txmbr is in the transaction
+ # else remove the updated txmbr
+ # it clean out some really wierd cases with dupes installed on the system
+ if not self.tsInfo.exists(pkg.pkgtup):
+ self.verbose_logger.debug('SKIPBROKEN: Remove extra updated %s (%s)' % (txmbr.po,pkg) )
+ self.tsInfo.remove(txmbr.po.pkgtup)
+
def _getPackagesToRemoveAllArch(self,po):
''' get all compatible arch packages in pkgSack'''
pkgs = []
More information about the Yum-commits
mailing list