[yum-commits] Branch 'yum-3_2_X' - test/skipbroken-tests.py yum/__init__.py

Tim Lauridsen timlau at osuosl.org
Wed Oct 29 13:59:12 UTC 2008


 test/skipbroken-tests.py |    6 +++---
 yum/__init__.py          |   20 ++++++++++++++++----
 2 files changed, 19 insertions(+), 7 deletions(-)

New commits:
commit 5e25798c6b86dca4a07454c4f86be0eb27b1d17f
Author: Tim Lauridsen <timlau at fedoraproject.org>
Date:   Wed Oct 29 14:58:50 2008 +0100

    make skip-broken better and solve the latest added test case

diff --git a/test/skipbroken-tests.py b/test/skipbroken-tests.py
index 9992416..28ce279 100644
--- a/test/skipbroken-tests.py
+++ b/test/skipbroken-tests.py
@@ -386,11 +386,11 @@ class SkipBrokenTests(DepsolveTests):
 
 
     def testBumpedSoName1(self):
-        """ This will fail because the skip-broken code can handle this case
+        """ 
         d2 need a lib from b1, so the update fails.
         d2 and b2 get skipped, but the installed b1 needs a
         lib from a1, but it has been updated to a2, so it is
-        no longer there.
+        no longer there. so a2 needs to be skipped to
         """
         a1 = self.instPackage('a', '1', arch='x86_64')
         a1.addProvides("liba.so.1()(64bit)")
@@ -427,7 +427,7 @@ class SkipBrokenTests(DepsolveTests):
         self.tsInfo.addUpdate(e2, oldpo=e1)
         self.tsInfo.addUpdate(f2, oldpo=f1)
         self.assertEquals('ok', *self.resolveCode(skip=True))
-        #self.assertResult([a2,b1,c2,d1,e2,f2])
+        self.assertResult([a1,b1,c1,d1,e2,f2])
     
     def resolveCode(self,skip = False):
         solver = YumBase()
diff --git a/yum/__init__.py b/yum/__init__.py
index 04f2aac..c4cb4fa 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -692,7 +692,8 @@ class YumBase(depsolve.Depsolve):
         count = 0
         skipped_po = set()
         removed_from_sack = set()
-        orig_restring = restring    # Keep the old error messages
+        orig_restring = restring    # Keep the old error messages 
+        hard_restart = False
         while len(self.po_with_problems) > 0 and rescode == 1:
             count += 1
             self.verbose_logger.debug(_("Skip-broken round %i"), count)
@@ -712,14 +713,25 @@ class YumBase(depsolve.Depsolve):
                     # 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':
                         _remove_from_sack(skip)
-            if not toRemove: # Nothing was removed, so we still got a problem
-                break # Bail out
+            # Nothing was removed, so we still got a problem
+             # the first time we get here we reset the resolved members of
+             # tsInfo and takes a new run all members in the current transaction
+            if not toRemove: 
+                if hard_restart:
+                    break # Bail out
+                else:
+                    self.tsInfo.resetResolved(hard=True)
             rescode, restring = self.resolveDeps()
             endTs = set(self.tsInfo)
              # Check if tsInfo has changes since we started to skip packages
              # if there is no changes then we got a loop.
+             # the first time we get here we reset the resolved members of
+             # tsInfo and takes a new run all members in the current transaction
             if startTs-endTs == set():
-                break    # bail out
+                if hard_restart:
+                    break # Bail out
+                else:
+                    self.tsInfo.resetResolved(hard=True)
         if rescode != 1:
             self.verbose_logger.debug(_("Skip-broken took %i rounds "), count)
             self.verbose_logger.info(_('\nPackages skipped because of dependency problems:'))


More information about the Yum-commits mailing list