1 |
commit: c7c04b4f4f4f5e6f18ad76366b535dcbad72989e |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Oct 27 19:40:01 2017 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Oct 27 19:42:44 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=c7c04b4f |
7 |
|
8 |
RsyncSync: fix PORTAGE_RSYNC_RETRIES (bug 497596) |
9 |
|
10 |
When PORTAGE_RSYNC_RETRIES is set to a positive integer, recycle |
11 |
the uris until the specified number of retries has been exhausted. |
12 |
|
13 |
Bug: https://bugs.gentoo.org/497596 |
14 |
|
15 |
pym/portage/sync/modules/rsync/rsync.py | 6 +++++- |
16 |
1 file changed, 5 insertions(+), 1 deletion(-) |
17 |
|
18 |
diff --git a/pym/portage/sync/modules/rsync/rsync.py b/pym/portage/sync/modules/rsync/rsync.py |
19 |
index 45a70e7dd..01e4e5924 100644 |
20 |
--- a/pym/portage/sync/modules/rsync/rsync.py |
21 |
+++ b/pym/portage/sync/modules/rsync/rsync.py |
22 |
@@ -202,6 +202,7 @@ class RsyncSync(NewBase): |
23 |
|
24 |
# reverse, for use with pop() |
25 |
uris.reverse() |
26 |
+ uris_orig = uris[:] |
27 |
|
28 |
effective_maxretries = maxretries |
29 |
if effective_maxretries < 0: |
30 |
@@ -210,10 +211,13 @@ class RsyncSync(NewBase): |
31 |
while (1): |
32 |
if uris: |
33 |
dosyncuri = uris.pop() |
34 |
- else: |
35 |
+ elif maxretries < 0 or retries > maxretries: |
36 |
writemsg("!!! Exhausted addresses for %s\n" |
37 |
% _unicode_decode(hostname), noiselevel=-1) |
38 |
return (1, False) |
39 |
+ else: |
40 |
+ uris.extend(uris_orig) |
41 |
+ dosyncuri = uris.pop() |
42 |
|
43 |
if (retries==0): |
44 |
if "--ask" in opts: |