Fix the obsoletes chain problem, as shown by dapl in EL4
authorJames Antill <james@and.org>
Wed, 8 Jul 2009 17:23:06 +0000 (13:23 -0400)
committerJames Antill <james@and.org>
Wed, 8 Jul 2009 21:17:28 +0000 (17:17 -0400)
test/operationstests.py
yum/__init__.py

index df52f9a..18f4b84 100644 (file)
@@ -68,7 +68,7 @@ class ComplicatedObsoletesTests(OperationsTests):
         p = self.pkgs
         res, msg = self.runOperation(['update'], [p.installed], [p.obsoletes, p.obsoletes2])
         self.assert_(res=='ok', msg)
-        if new_behavior:
+        if True or new_behavior:
             self.assertResult((p.obsoletes2,))
         else:
             self.assertResult((p.obsoletes,))
@@ -85,7 +85,7 @@ class ComplicatedObsoletesTests(OperationsTests):
         if new_behavior:
             self.assertResult((p.obsoletecircle,))
         else:
-            self.assertResult((p.obsoletes,))
+            self.assertResult((p.obsoletes2,))
     def testObsoleteCircleNext(self):
         p = self.pkgs
         res, msg = self.runOperation(['update'], [p.obsoletes], [p.obsoletecircle, p.obsoletes, p.obsoletes2])
@@ -109,7 +109,7 @@ class ComplicatedObsoletesTests(OperationsTests):
         if new_behavior:
             self.assertResult((p.obsoletecircle,))
         else:
-            self.assertResult((p.obsoletes,))
+            self.assertResult((p.obsoletes2,))
     # continue endlessly
     
 class KernelTests(OperationsTests):
index 2f9723b..961516c 100644 (file)
@@ -2842,6 +2842,9 @@ class YumBase(depsolve.Depsolve):
 
             for (obsoleting, installed) in obsoletes:
                 obsoleting_pkg = self.getPackageObject(obsoleting)
+                topkg = self._test_loop(obsoleting_pkg, self._pkg2obspkg)
+                if topkg is not None:
+                    obsoleting_pkg = topkg
                 installed_pkg =  self.rpmdb.searchPkgTuple(installed)[0]
                 txmbr = self.tsInfo.addObsoleting(obsoleting_pkg, installed_pkg)
                 self.tsInfo.addObsoleted(installed_pkg, obsoleting_pkg)