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 E60BE158012 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 6CCF5E08A0; Tue, 21 Sep 2021 05:51:55 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 54810E08A0 for ; Tue, 21 Sep 2021 05:51:55 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B6FCC342F28 for ; Tue, 21 Sep 2021 05:51:53 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 2D343CF 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: <1632202430.5d61d0f8d72b27213896f052ef4abb2337b922bf.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: lib/_emerge/, lib/portage/util/_async/ X-VCS-Repository: proj/portage X-VCS-Files: lib/_emerge/Binpkg.py lib/portage/util/_async/AsyncTaskFuture.py X-VCS-Directories: lib/_emerge/ lib/portage/util/_async/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 5d61d0f8d72b27213896f052ef4abb2337b922bf 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: f6f0aa16-30ab-49a7-8c01-d39cd5eda980 X-Archives-Hash: e1679dfaae6eaf235bce0f1f60a9f0f7 commit: 5d61d0f8d72b27213896f052ef4abb2337b922bf Author: Zac Medico gentoo org> AuthorDate: Tue Sep 21 04:53:52 2021 +0000 Commit: Zac Medico gentoo org> CommitDate: Tue Sep 21 05:33:50 2021 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=5d61d0f8 Binpkg: convert compat coroutine to async Signed-off-by: Zac Medico gentoo.org> lib/_emerge/Binpkg.py | 10 ++++------ lib/portage/util/_async/AsyncTaskFuture.py | 4 +++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/_emerge/Binpkg.py b/lib/_emerge/Binpkg.py index 0f37063f0..c7dde69bd 100644 --- a/lib/_emerge/Binpkg.py +++ b/lib/_emerge/Binpkg.py @@ -1,4 +1,4 @@ -# Copyright 1999-2019 Gentoo Authors +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 import functools @@ -15,7 +15,6 @@ from _emerge.SpawnProcess import SpawnProcess from portage.eapi import eapi_exports_replace_vars from portage.util import ensure_dirs from portage.util._async.AsyncTaskFuture import AsyncTaskFuture -from portage.util.futures.compat_coroutine import coroutine import portage from portage import os from portage import shutil @@ -305,8 +304,7 @@ class Binpkg(CompositeTask): self._unpack_metadata_exit, ) - @coroutine - def _unpack_metadata(self, loop=None): + async def _unpack_metadata(self, loop=None): dir_path = self.settings["PORTAGE_BUILDDIR"] @@ -327,7 +325,7 @@ class Binpkg(CompositeTask): portage.prepare_build_dirs(self.settings["ROOT"], self.settings, 1) self._writemsg_level(">>> Extracting info\n") - yield self._bintree.dbapi.unpack_metadata( + await self._bintree.dbapi.unpack_metadata( self.settings, infloc, loop=self.scheduler ) check_missing_metadata = ("CATEGORY", "PF") @@ -378,7 +376,7 @@ class Binpkg(CompositeTask): background=self.background, scheduler=self.scheduler, settings=self.settings ) env_extractor.start() - yield env_extractor.async_wait() + await env_extractor.async_wait() if env_extractor.returncode != os.EX_OK: raise portage.exception.PortageException( "failed to extract environment for {}".format(self.pkg.cpv) diff --git a/lib/portage/util/_async/AsyncTaskFuture.py b/lib/portage/util/_async/AsyncTaskFuture.py index f87a7f90a..0cd034c97 100644 --- a/lib/portage/util/_async/AsyncTaskFuture.py +++ b/lib/portage/util/_async/AsyncTaskFuture.py @@ -1,10 +1,11 @@ -# Copyright 2018 Gentoo Foundation +# Copyright 2018-2021 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import os import signal from _emerge.AsynchronousTask import AsynchronousTask +from portage.util.futures import asyncio class AsyncTaskFuture(AsynchronousTask): @@ -16,6 +17,7 @@ class AsyncTaskFuture(AsynchronousTask): __slots__ = ("future",) def _start(self): + self.future = asyncio.ensure_future(self.future, self.scheduler) self.future.add_done_callback(self._done_callback) def _cancel(self):