Blame SOURCES/BZ-1041395-depsolve-loop-limit.patch

d2a170
commit cfd0f0f8ad4bb285755ecc66e528a807f864b4ca
d2a170
Author: Zdenek Pavlas <zpavlas@redhat.com>
d2a170
Date:   Wed Dec 11 15:09:28 2013 +0100
d2a170
d2a170
    depsolve_loop_limit=<forever> should try forever
d2a170
d2a170
diff --git a/docs/yum.conf.5 b/docs/yum.conf.5
d2a170
index da13dc8..48ced00 100644
d2a170
--- a/docs/yum.conf.5
d2a170
+++ b/docs/yum.conf.5
d2a170
@@ -882,7 +882,7 @@ Default is: !*/swap !*/lv_swap glob:/etc/yum/fssnap.d/*.conf
d2a170
 Set the number of times any attempt to depsolve before we just give up. This
d2a170
 shouldn't be needed as yum should always solve or fail, however it has been
d2a170
 observed that it can loop forever with very large system upgrades. Setting
d2a170
-this to `0' (or "forever") makes yum try forever. Default is `100'.
d2a170
+this to `0' (or "<forever>") makes yum try forever. Default is `100'.
d2a170
 
d2a170
 
d2a170
 .SH "[repository] OPTIONS"
d2a170
diff --git a/yum/depsolve.py b/yum/depsolve.py
d2a170
index 8b438bb..81bfdf8 100644
d2a170
--- a/yum/depsolve.py
d2a170
+++ b/yum/depsolve.py
d2a170
@@ -870,7 +870,7 @@ class Depsolve(object):
d2a170
         if self.dsCallback: self.dsCallback.start()
d2a170
 
d2a170
         depsolve_loop_count = 0
d2a170
-        while depsolve_loop_count < self.conf.depsolve_loop_limit:
d2a170
+        while depsolve_loop_count != (self.conf.depsolve_loop_limit or -1):
d2a170
             depsolve_loop_count += 1
d2a170
 
d2a170
             CheckDeps = True
d2a170
commit 57f063c11cc8712ce8055d9e9429d897d7d0072c
d2a170
Author: Zdenek Pavlas <zpavlas@redhat.com>
d2a170
Date:   Thu Dec 12 10:32:49 2013 +0100
d2a170
d2a170
    Test depsolve_loop_count vs depsolve_loop_limit only once
d2a170
d2a170
diff --git a/yum/depsolve.py b/yum/depsolve.py
d2a170
index 81bfdf8..95c21bc 100644
d2a170
--- a/yum/depsolve.py
d2a170
+++ b/yum/depsolve.py
d2a170
@@ -870,7 +870,9 @@ class Depsolve(object):
d2a170
         if self.dsCallback: self.dsCallback.start()
d2a170
 
d2a170
         depsolve_loop_count = 0
d2a170
-        while depsolve_loop_count != (self.conf.depsolve_loop_limit or -1):
d2a170
+        while True:
d2a170
+            if depsolve_loop_count == (self.conf.depsolve_loop_limit or -1):
d2a170
+                return (1, [_("Depsolving loop limit reached.")] + unique(errors))
d2a170
             depsolve_loop_count += 1
d2a170
 
d2a170
             CheckDeps = True
d2a170
@@ -922,9 +924,6 @@ class Depsolve(object):
d2a170
 
d2a170
             break
d2a170
 
d2a170
-        if depsolve_loop_count >= self.conf.depsolve_loop_limit:
d2a170
-            return (1, [_("Depsolving loop limit reached.")] + unique(errors))
d2a170
-
d2a170
         # FIXME: this doesn't belong here at all...
d2a170
         for txmbr in self.tsInfo.getMembers():
d2a170
             if self.allowedMultipleInstalls(txmbr.po) and \