Fix PORTAGE_RSYNC_RETRIES functionality so it works according to the documentation in 'man make.conf'. --- a/pym/portage/sync/modules/rsync/rsync.py +++ b/pym/portage/sync/modules/rsync/rsync.py @@ -144,6 +144,7 @@ class RsyncSync(NewBase): addrinfos = None uris = [] + uris_save = [] try: addrinfos = getaddrinfo_validate( @@ -203,10 +204,17 @@ class RsyncSync(NewBase): while (1): if uris: dosyncuri = uris.pop() + uris_save.append(dosyncuri) else: - writemsg("!!! Exhausted addresses for %s\n" - % _unicode_decode(hostname), noiselevel=-1) - return (1, False) + if maxretries < 0 or retries > maxretries: + writemsg("!!! Exhausted addresses for %s\n" + % _unicode_decode(hostname), noiselevel=-1) + return (1, False) + else: + uris_save.reverse() + uris = uris_save + dosyncuri = uris_save.pop() + uris_save = [dosyncuri] if (retries==0): if "--ask" in opts: