c-ares: upgraded package to upstream

Upgraded net-dns/c-ares to version 1.17.2 on amd64, arm64

Upgrading net-misc/curl to a version that would resolve
CVE-2021-22945 broke some DNS resolution functionality. Upgrading the
c-ares package fixed that functionality.

BUG=b/202379404
TEST=presubmit,validation tests
RELEASE_NOTE=Upgraded net-dns/c-ares to 1.17.2.

Change-Id: Ifbdd43b7ce1ce9bf88b3acbf955c92344fa4ccc0
Reviewed-on: https://cos-review.googlesource.com/c/third_party/overlays/portage-stable/+/23910
Reviewed-by: Vaibhav Rustagi <vaibhavrustagi@google.com>
Tested-by: Cusky Presubmit Bot <presubmit@cos-infra-prod.iam.gserviceaccount.com>
diff --git a/metadata/md5-cache/net-dns/c-ares-1.16.1 b/metadata/md5-cache/net-dns/c-ares-1.16.1
deleted file mode 100644
index 7867400..0000000
--- a/metadata/md5-cache/net-dns/c-ares-1.16.1
+++ /dev/null
@@ -1,13 +0,0 @@
-BDEPEND=>=app-portage/elt-patches-20170815
-DEFINED_PHASES=compile configure install prepare test
-DEPEND=!<sys-devel/gettext-0.18.1.1-r3 || ( >=sys-devel/automake-1.16.1:1.16 >=sys-devel/automake-1.15.1:1.15 ) >=sys-devel/autoconf-2.69 >=sys-devel/libtool-2.4
-DESCRIPTION=C library that resolves names asynchronously
-EAPI=7
-HOMEPAGE=https://c-ares.haxx.se/
-IUSE=static-libs abi_x86_32 abi_x86_64 abi_x86_x32 abi_mips_n32 abi_mips_n64 abi_mips_o32 abi_ppc_32 abi_ppc_64 abi_s390_32 abi_s390_64 abi_arm_32 abi_arm_64
-KEYWORDS=*
-LICENSE=MIT
-SLOT=0/2
-SRC_URI=https://c-ares.haxx.se/download/c-ares-1.16.1.tar.gz
-_eclasses_=autotools	d0e5375d47f4c809f406eb892e531513	eutils	fcb2aa98e1948b835b5ae66ca52868c5	libtool	f143db5a74ccd9ca28c1234deffede96	multibuild	40fe59465edacd730c644ec2bc197809	multilib	2477ebe553d3e4d2c606191fe6c33602	multilib-build	1979aa0ff4d356d32507ca4650d9f37d	multilib-minimal	8bddda43703ba94d8341f4e247f97566	toolchain-funcs	605c126bed8d87e4378d5ff1645330cb
-_md5_=a4702d4f439c7ff653da3fd3b0e65f6a
diff --git a/metadata/md5-cache/net-dns/c-ares-1.17.2 b/metadata/md5-cache/net-dns/c-ares-1.17.2
new file mode 100644
index 0000000..8a5970b
--- /dev/null
+++ b/metadata/md5-cache/net-dns/c-ares-1.17.2
@@ -0,0 +1,14 @@
+BDEPEND=>=app-portage/elt-patches-20170815
+DEFINED_PHASES=compile configure install test
+DEPEND=!<sys-devel/gettext-0.18.1.1-r3 || ( >=sys-devel/automake-1.16.1:1.16 >=sys-devel/automake-1.15.1:1.15 ) >=sys-devel/autoconf-2.69 >=sys-devel/libtool-2.4
+DESCRIPTION=C library that resolves names asynchronously
+EAPI=7
+HOMEPAGE=https://c-ares.haxx.se/
+IUSE=static-libs test abi_x86_32 abi_x86_64 abi_x86_x32 abi_mips_n32 abi_mips_n64 abi_mips_o32 abi_ppc_32 abi_ppc_64 abi_s390_32 abi_s390_64 abi_arm_32 abi_arm_64
+KEYWORDS=*
+LICENSE=MIT
+RESTRICT=!test? ( test )
+SLOT=0/2
+SRC_URI=https://c-ares.haxx.se/download/c-ares-1.17.2.tar.gz
+_eclasses_=autotools	d0e5375d47f4c809f406eb892e531513	libtool	f143db5a74ccd9ca28c1234deffede96	multibuild	40fe59465edacd730c644ec2bc197809	multilib	2477ebe553d3e4d2c606191fe6c33602	multilib-build	1979aa0ff4d356d32507ca4650d9f37d	multilib-minimal	8bddda43703ba94d8341f4e247f97566	toolchain-funcs	605c126bed8d87e4378d5ff1645330cb
+_md5_=76128cfc9218bc78d4d953b135610d89
diff --git a/net-dns/c-ares/Manifest b/net-dns/c-ares/Manifest
index 4ebd15a..38e4437 100644
--- a/net-dns/c-ares/Manifest
+++ b/net-dns/c-ares/Manifest
@@ -1 +1 @@
-DIST c-ares-1.16.1.tar.gz 1374637 BLAKE2B 0d87538f5d6cac5b6b9c92d6ba5525af0e580e6506bee9270318f0951aaccdc7e135b446381e8150241d367789ccf2f73dbb333d45de4dbb5a87af05483063a8 SHA512 4ac2a5d5c6da74eb1d6155c4eadc7127ab1b53a8d13caec41bd6172db5417a79f3ab022e77ba37d8b13da6893d7ced5fd8baf5cc3950a4154b4de8743ad31471
+DIST c-ares-1.17.2.tar.gz 1538276 BLAKE2B c6f5ad65ca75f8467b624daf3caaee2f35d6e4714ce46ebe1bbf79447feecf8615915b00fa5e7bd1e97c6232864e06c53a792fbadf36a5399883529769273e24 SHA512 f625e0ef8508af6475d3e83b51ab29be8a4878e2a87e7f518bea046b76a74bfde7043ca6ec2a9e714c898ab9e5d4a5a678c3347a9f9eb68980438f7ca8ae3fc8
diff --git a/net-dns/c-ares/c-ares-1.16.1.ebuild b/net-dns/c-ares/c-ares-1.16.1.ebuild
deleted file mode 100644
index ea691d2..0000000
--- a/net-dns/c-ares/c-ares-1.16.1.ebuild
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit autotools eutils multilib-minimal
-
-DESCRIPTION="C library that resolves names asynchronously"
-HOMEPAGE="https://c-ares.haxx.se/"
-SRC_URI="https://${PN}.haxx.se/download/${P}.tar.gz"
-
-LICENSE="MIT"
-KEYWORDS="*"
-IUSE="static-libs"
-
-# Subslot = SONAME of libcares.so.2
-SLOT="0/2"
-
-DOCS=( AUTHORS CHANGES NEWS README.md RELEASE-NOTES TODO )
-
-MULTILIB_WRAPPED_HEADERS=(
-	/usr/include/ares_build.h
-)
-
-src_prepare() {
-	eapply "${FILESDIR}"/${PN}-1.12.0-remove-tests.patch
-	eapply_user
-	eautoreconf
-}
-
-multilib_src_configure() {
-	ECONF_SOURCE=${S} \
-	econf \
-		--enable-nonblocking \
-		--enable-symbol-hiding \
-		$(use_enable static-libs static)
-}
-
-multilib_src_install_all() {
-	einstalldocs
-	find "${ED}" -name "*.la" -delete || die
-}
diff --git a/net-dns/c-ares/c-ares-1.17.2.ebuild b/net-dns/c-ares/c-ares-1.17.2.ebuild
new file mode 100644
index 0000000..58828c0
--- /dev/null
+++ b/net-dns/c-ares/c-ares-1.17.2.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools multilib-minimal
+
+DESCRIPTION="C library that resolves names asynchronously"
+HOMEPAGE="https://c-ares.haxx.se/"
+SRC_URI="https://${PN}.haxx.se/download/${P}.tar.gz"
+
+# Subslot = SONAME of libcares.so.2
+SLOT="0/2"
+LICENSE="MIT"
+KEYWORDS="*"
+IUSE="static-libs test"
+RESTRICT="!test? ( test )"
+
+DOCS=( AUTHORS CHANGES NEWS README.md RELEASE-NOTES TODO )
+
+MULTILIB_WRAPPED_HEADERS=(
+	/usr/include/ares_build.h
+)
+
+multilib_src_configure() {
+	# Needed for running unit tests only
+	# Violates sandbox and tests pass fine without
+	ax_cv_uts_namespace=no \
+	ax_cv_user_namespace=no \
+	ECONF_SOURCE="${S}" \
+	econf \
+		--enable-nonblocking \
+		--enable-symbol-hiding \
+		$(use_enable static-libs static) \
+		$(use_enable test tests)
+}
+
+multilib_src_test() {
+	cd "${BUILD_DIR}"/test || die
+
+	# We're skipping the "real" network tests with the filter
+	# see https://github.com/c-ares/c-ares/tree/main/test
+	local network_tests=(
+		# Most live tests have Live in the name
+		*Live*
+		# These don't but are still in ares-test-live.cc => live
+		*GetTCPSock*
+		*TimeoutValue*
+		*GetSock*
+		*GetSock_virtualized*
+	)
+
+	# The format for disabling test1, test2, and test3 looks like:
+	# -test1:test2:test3
+	./arestest --gtest_filter=-$(echo $(IFS=:; echo "${network_tests[*]}")) || die "arestest failed!"
+}
+
+multilib_src_install_all() {
+	einstalldocs
+
+	find "${ED}" -name "*.la" -delete || die
+}
diff --git a/net-dns/c-ares/files/c-ares-1.12.0-remove-tests.patch b/net-dns/c-ares/files/c-ares-1.12.0-remove-tests.patch
deleted file mode 100644
index 826eb85..0000000
--- a/net-dns/c-ares/files/c-ares-1.12.0-remove-tests.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff -Naur c-ares-1.12.0.orig/configure.ac c-ares-1.12.0/configure.ac
---- c-ares-1.12.0.orig/configure.ac	2016-09-29 07:43:01.000000000 -0400
-+++ c-ares-1.12.0/configure.ac	2016-10-14 03:10:36.253342032 -0400
-@@ -837,10 +837,6 @@
- fi
- AC_MSG_RESULT([$build_tests])
- 
--if test "x$build_tests" = "xyes" ; then
--  AC_CONFIG_SUBDIRS([test])
--fi
--
- AC_CONFIG_FILES([Makefile libcares.pc])
- AC_OUTPUT
- XC_AMEND_DISTCLEAN(['.'])
diff --git a/net-dns/c-ares/metadata.xml b/net-dns/c-ares/metadata.xml
index 1b514de..61b0198 100644
--- a/net-dns/c-ares/metadata.xml
+++ b/net-dns/c-ares/metadata.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
 <maintainer type="person">
   <email>blueness@gentoo.org</email>