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 56AB5158013 for ; Tue, 21 Sep 2021 05:51:57 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A17A7E08BF; Tue, 21 Sep 2021 05:51:56 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 80B91E08BF for ; Tue, 21 Sep 2021 05:51:56 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5FDB2342F2A for ; Tue, 21 Sep 2021 05:51:55 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8FFF0108 for ; Tue, 21 Sep 2021 05:51:52 +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: <1632202431.bcda30d0a6fa4962cc7597dbed9b648cf6400ab5.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/dbapi/ X-VCS-Repository: proj/portage X-VCS-Files: lib/portage/dbapi/vartree.py X-VCS-Directories: lib/portage/dbapi/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: bcda30d0a6fa4962cc7597dbed9b648cf6400ab5 X-VCS-Branch: master Date: Tue, 21 Sep 2021 05:51:52 +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: 0241e2e5-6e8e-4f3e-ba49-3a6e31e6cd86 X-Archives-Hash: 34006df072b8e81bfe7f4e65901615e0 commit: bcda30d0a6fa4962cc7597dbed9b648cf6400ab5 Author: Zac Medico gentoo org> AuthorDate: Tue Sep 21 05:21:55 2021 +0000 Commit: Zac Medico gentoo org> CommitDate: Tue Sep 21 05:33:51 2021 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=bcda30d0 vardbapi: convert compat coroutine to async Signed-off-by: Zac Medico gentoo.org> lib/portage/dbapi/vartree.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/portage/dbapi/vartree.py b/lib/portage/dbapi/vartree.py index 7f3b5d773..8ffb23b1c 100644 --- a/lib/portage/dbapi/vartree.py +++ b/lib/portage/dbapi/vartree.py @@ -78,7 +78,6 @@ from portage import _os_merge from portage import _selinux_merge from portage import _unicode_decode from portage import _unicode_encode -from portage.util.futures.compat_coroutine import coroutine from portage.util.futures.executor.fork import ForkExecutor from ._VdbMetadataDelta import VdbMetadataDelta @@ -1006,8 +1005,7 @@ class vardbapi(dbapi): pass self._bump_mtime(cpv) - @coroutine - def unpack_metadata(self, pkg, dest_dir, loop=None): + async def unpack_metadata(self, pkg, dest_dir, loop=None): """ Unpack package metadata to a directory. This method is a coroutine. @@ -1029,10 +1027,9 @@ class vardbapi(dbapi): shutil.copy(os.path.join(parent, key), os.path.join(dest_dir, key)) break - yield loop.run_in_executor(ForkExecutor(loop=loop), async_copy) + await loop.run_in_executor(ForkExecutor(loop=loop), async_copy) - @coroutine - def unpack_contents( + async def unpack_contents( self, pkg, dest_dir, @@ -1097,10 +1094,10 @@ class vardbapi(dbapi): tar_cmd = ("tar", "-x", "--xattrs", "--xattrs-include=*", "-C", dest_dir) pr, pw = os.pipe() - proc = yield asyncio.create_subprocess_exec(*tar_cmd, stdin=pr) + proc = await asyncio.create_subprocess_exec(*tar_cmd, stdin=pr) os.close(pr) with os.fdopen(pw, "wb", 0) as pw_file: - excluded_config_files = yield loop.run_in_executor( + excluded_config_files = await loop.run_in_executor( ForkExecutor(loop=loop), functools.partial( self._dblink(cpv).quickpkg, @@ -1109,7 +1106,7 @@ class vardbapi(dbapi): include_unmodified_config=opts.include_unmodified_config == "y", ), ) - yield proc.wait() + await proc.wait() if proc.returncode != os.EX_OK: raise PortageException("command failed: {}".format(tar_cmd))