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:01 +0000 (10:11 -0700)
pym/_emerge/actions.py

index c768edd13cd5005f85529f378470d487011d01d7..2f0c0756a90019c604ef261c75906879d829b4ff 100644 (file)
@@ -2117,6 +2117,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):
@@ -2142,9 +2146,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))