yifengyou / rpms / yum

Forked from rpms/yum 3 years ago
Clone

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

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