Calculate maxretries before len(ips) changes.
authorZac Medico <zmedico@gentoo.org>
Thu, 7 Oct 2010 17:11:08 +0000 (10:11 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 7 Oct 2010 17:11:08 +0000 (10:11 -0700)
pym/_emerge/actions.py

index d064facd1c00c3aae6717b4e62821b946843a387..2aabb25b3f3329a811fbced00df48bafcfed0e77 100644 (file)
@@ -2127,6 +2127,10 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
                # reverse, for use with pop()
                ips.reverse()
 
+               effective_maxretries = maxretries
+               if effective_maxretries < 0:
+                       effective_maxretries = len(ips)
+
                SERVER_OUT_OF_DATE = -1
                EXCEEDED_MAX_RETRIES = -2
                while (1):
@@ -2152,9 +2156,6 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
                                if "--quiet" not in myopts:
                                        print(">>> Starting rsync with "+dosyncuri+"...")
                        else:
-                               effective_maxretries = maxretries
-                               if effective_maxretries < 0:
-                                       effective_maxretries = len(ips)
                                emergelog(xterm_titles,
                                        ">>> Starting retry %d of %d with %s" % \
                                                (retries, effective_maxretries, dosyncuri))