1 |
commit: 051d75acf5e3fbca7c1083cb612e5f07a3a98919 |
2 |
Author: Frédéric Pierret (fepitre) <frederic.pierret <AT> qubes-os <DOT> org> |
3 |
AuthorDate: Tue Aug 4 13:12:08 2020 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Sep 7 22:49:53 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=051d75ac |
7 |
|
8 |
rsync: ignore addrinfos with proxy settings |
9 |
|
10 |
Not doing so makes getting addrinfos failing due to |
11 |
"Temporary failure in name resolution" due to proxy settings. |
12 |
|
13 |
An alternative to this solution would be to define a socks.setdefaultproxy |
14 |
and passing socks.socksocket to socket. |
15 |
|
16 |
Bug: https://bugs.gentoo.org/740904 |
17 |
See: https://github.com/gentoo/portage/pull/607 |
18 |
Signed-off-by: Frédéric Pierret (fepitre) <frederic.pierret <AT> qubes-os.org> |
19 |
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org> |
20 |
|
21 |
lib/portage/sync/modules/rsync/rsync.py | 19 ++++++++++--------- |
22 |
1 file changed, 10 insertions(+), 9 deletions(-) |
23 |
|
24 |
diff --git a/lib/portage/sync/modules/rsync/rsync.py b/lib/portage/sync/modules/rsync/rsync.py |
25 |
index 88b36ab79..35d1461e4 100644 |
26 |
--- a/lib/portage/sync/modules/rsync/rsync.py |
27 |
+++ b/lib/portage/sync/modules/rsync/rsync.py |
28 |
@@ -230,15 +230,16 @@ class RsyncSync(NewBase): |
29 |
addrinfos = None |
30 |
uris = [] |
31 |
|
32 |
- try: |
33 |
- addrinfos = getaddrinfo_validate( |
34 |
- socket.getaddrinfo(getaddrinfo_host, None, |
35 |
- family, socket.SOCK_STREAM)) |
36 |
- except socket.error as e: |
37 |
- writemsg_level( |
38 |
- "!!! getaddrinfo failed for '%s': %s\n" |
39 |
- % (_unicode_decode(hostname), str(e)), |
40 |
- noiselevel=-1, level=logging.ERROR) |
41 |
+ if 'RSYNC_PROXY' not in self.spawn_kwargs['env']: |
42 |
+ try: |
43 |
+ addrinfos = getaddrinfo_validate( |
44 |
+ socket.getaddrinfo( |
45 |
+ getaddrinfo_host, None, family, socket.SOCK_STREAM)) |
46 |
+ except socket.error as e: |
47 |
+ writemsg_level( |
48 |
+ "!!! getaddrinfo failed for '%s': %s\n" |
49 |
+ % (_unicode_decode(hostname), str(e)), |
50 |
+ noiselevel=-1, level=logging.ERROR) |
51 |
|
52 |
if addrinfos: |