summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-10-13 20:44:30 -0700
committerZac Medico <zmedico@gentoo.org>2010-10-13 20:49:24 -0700
commit56adeb8963f2ed629d0e1dbd85f7e9695fd772d4 (patch)
treeee0d3ea6d1c1fe055592829da39352834fc55cc1
parentBug #340899 - Validate getaddrinfo() results. (diff)
downloadportage-56adeb8963f2ed629d0e1dbd85f7e9695fd772d4.tar.gz
portage-56adeb8963f2ed629d0e1dbd85f7e9695fd772d4.tar.bz2
portage-56adeb8963f2ed629d0e1dbd85f7e9695fd772d4.zip
Ensure getaddrinfo fallback works when necessary.v2.1.9.18
-rw-r--r--pym/_emerge/actions.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 0ac7e3de5..708ff0ff5 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2099,11 +2099,7 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
"!!! getaddrinfo failed for '%s': %s\n" % (hostname, e),
noiselevel=-1, level=logging.ERROR)
- if not addrinfos:
- # With some configurations we need to use the plain hostname
- # rather than try to resolve the ip addresses (bug #340817).
- uris.append(syncuri)
- else:
+ if addrinfos:
AF_INET = socket.AF_INET
AF_INET6 = None
@@ -2136,6 +2132,11 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
"//" + user_name + hostname + port + "/",
"//" + user_name + ip + port + "/", 1))
+ if not uris:
+ # With some configurations we need to use the plain hostname
+ # rather than try to resolve the ip addresses (bug #340817).
+ uris.append(syncuri)
+
# reverse, for use with pop()
uris.reverse()