From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 15 Mar 2024 09:02:21 +0100 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rl2WD-007Utu-0D for lore@lore.pengutronix.de; Fri, 15 Mar 2024 09:02:21 +0100 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1rl2WC-0000Fd-EX; Fri, 15 Mar 2024 09:02:20 +0100 Received: from ptz.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::77] helo=[127.0.0.1]) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1rl2W9-0000D3-1z for distrokit@pengutronix.de; Fri, 15 Mar 2024 09:02:17 +0100 Message-ID: <3ae8bb89-88d9-47a7-9c6c-aeafb57b829a@pengutronix.de> Date: Fri, 15 Mar 2024 09:02:48 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: distrokit@pengutronix.de References: <20240315073528.3566983-1-l.goehrs@pengutronix.de> Content-Language: en-US From: =?UTF-8?Q?Leonard_G=C3=B6hrs?= In-Reply-To: <20240315073528.3566983-1-l.goehrs@pengutronix.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [DistroKit] [PATCH] targets: yocto: do not fail when optee-os is not found X-BeenThere: distrokit@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: DistroKit Mailinglist List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "DistroKit" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: distrokit-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false Hi, sorry for the noise. This patch was meant for another mailing list, but the git send-email --to distrokit@pengutronix.de command was the most recent one in my shell history and I sent it here by accident. On 15.03.24 08:35, Leonard Göhrs wrote: > This fixes commit 7e16f18 ("targets: yocto: try finding and generating > optee-os conf.mk"), which failed with a TargetError when optee-os is > not found instead of just trying to find it. > > Signed-off-by: Leonard Göhrs > --- > reason/targets/yocto.py | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/reason/targets/yocto.py b/reason/targets/yocto.py > index 87220c8..0c21e49 100644 > --- a/reason/targets/yocto.py > +++ b/reason/targets/yocto.py > @@ -1,5 +1,6 @@ > #!/usr/bin/python3 > > +import contextlib > from logging import LogRecord > import os > > @@ -52,14 +53,14 @@ class YoctoTarget(Target): > except bb.providers.NoProvider: > raise TargetError("No busybox recipe found") > > - try: > + with contextlib.suppress(bb.providers.NoProvider): > + # tinfoil.parse_recipe() may raise bb.providers.NoProvider, > + # in this case we leave self.aliases[b'OPTEECONFIG'] unset. > rd = self.tinfoil.parse_recipe('optee-os') > > builddir = rd.getVar('B') > if builddir: > self.aliases[b'OPTEECONFIG'] = os.path.join(builddir.encode(), b'conf.mk') > - except bb.providers.NoProvider: > - raise TargetError("No optee-os recipe found") > > # generate .config files if those do not exist, yet. > if b'KERNELCONFIG' in self.aliases and not os.path.exists(self.aliases[b'KERNELCONFIG']): > > base-commit: a46729ec6ffd1c11fc94da2c6f3f4caba86581db