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

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