From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id D4D33138334 for ; Wed, 17 Jul 2019 05:06:54 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CB517E07AE; Wed, 17 Jul 2019 05:06:53 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 65CFFE07AE for ; Wed, 17 Jul 2019 05:06:53 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0B72C347CE6 for ; Wed, 17 Jul 2019 05:06:52 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7291858B for ; Wed, 17 Jul 2019 05:06:49 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1562994560.95ba3ca5e8db2a6b360e4abdcee026076652551d.zmedico@gentoo> Subject: [gentoo-commits] proj/mirrorselect:master commit in: mirrorselect/ X-VCS-Repository: proj/mirrorselect X-VCS-Files: mirrorselect/selectors.py X-VCS-Directories: mirrorselect/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 95ba3ca5e8db2a6b360e4abdcee026076652551d X-VCS-Branch: master Date: Wed, 17 Jul 2019 05:06:49 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 1d6b735c-4e76-4f17-a04e-427184ba8d8b X-Archives-Hash: 091b74c030c33620aa0ee408ce1dee43 commit: 95ba3ca5e8db2a6b360e4abdcee026076652551d Author: Zac Medico gentoo org> AuthorDate: Sat Jul 13 05:00:33 2019 +0000 Commit: Zac Medico gentoo org> CommitDate: Sat Jul 13 05:09:20 2019 +0000 URL: https://gitweb.gentoo.org/proj/mirrorselect.git/commit/?id=95ba3ca5 netselect: make netselect ipv6 support optional Since netselect with ipv6 support does not work on a system where ipv6 is disabled, use a NETSELECT_SUPPORTS_IPV4_IPV6 variable to optionally enable the use of netselect -4/-6 options. The ebuild will use sed to set NETSELECT_SUPPORTS_IPV4_IPV6 = True when USE=ipv6 is enabled, and will have a dependency like RDEPEND=">=net-analyzer/netselect-0.4[ipv6(+)?]". Bug: https://bugs.gentoo.org/688214 Signed-off-by: Zac Medico gentoo.org> mirrorselect/selectors.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/mirrorselect/selectors.py b/mirrorselect/selectors.py index e3f718c..4564f11 100644 --- a/mirrorselect/selectors.py +++ b/mirrorselect/selectors.py @@ -61,6 +61,11 @@ else: from mirrorselect.output import encoder, get_encoding, decode_selection +# The netselect --ipv4 and --ipv6 options are supported only +# with >=net-analyzer/netselect-0.4[ipv6(+)]. +NETSELECT_SUPPORTS_IPV4_IPV6 = False + + class Shallow(object): """handles rapid server selection via netselect""" @@ -96,10 +101,12 @@ class Shallow(object): host_string = ' '.join(hosts) cmd = ['netselect', '-s%d' % (number,)] - if self._options.ipv4: - cmd.append('-4') - elif self._options.ipv6: - cmd.append('-6') + + if NETSELECT_SUPPORTS_IPV4_IPV6: + if self._options.ipv4: + cmd.append('-4') + elif self._options.ipv6: + cmd.append('-6') cmd.extend(hosts)