summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-10-04 15:11:11 -0700
committerZac Medico <zmedico@gentoo.org>2010-10-06 15:59:06 -0700
commitcc71be4c6382a27338314e0646d3900fb4557044 (patch)
tree31f13cdf65fd46c2a46924f88a57a1d8970dc4b1
parentb0cf8e0fe9a858ba9db6a00ef7fe8eac760d6ce2 (diff)
downloadportage-cc71be4c6382a27338314e0646d3900fb4557044.tar.gz
portage-cc71be4c6382a27338314e0646d3900fb4557044.tar.bz2
portage-cc71be4c6382a27338314e0646d3900fb4557044.zip
Add back --sync IPv4/IPv6 override support.
-rw-r--r--pym/_emerge/actions.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 18a3a9298..04f471967 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2079,12 +2079,19 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
settings.get("PORTAGE_RSYNC_EXTRA_OPTS",""))
all_rsync_opts.update(extra_rsync_opts)
+ family = socket.AF_UNSPEC
+ if "-4" in all_rsync_opts or "--ipv4" in all_rsync_opts:
+ family = socket.AF_INET
+ elif socket.has_ipv6 and \
+ ("-6" in all_rsync_opts or "--ipv6" in all_rsync_opts):
+ family = socket.AF_INET6
+
ips_v4 = []
ips_v6 = []
try:
addrinfos = socket.getaddrinfo(hostname, None,
- socket.AF_UNSPEC, socket.SOCK_STREAM)
+ family, socket.SOCK_STREAM)
except socket.error as e:
writemsg("!!! getaddrinfo failed: %s\n" % (e,), noiselevel=-1)
return 1