From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 15 Mar 2024 08:35:41 +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 1rl26P-007RcU-15 for lore@lore.pengutronix.de; Fri, 15 Mar 2024 08:35:41 +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 1rl26O-0004N2-8a; Fri, 15 Mar 2024 08:35:40 +0100 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rl26H-0004KS-5T; Fri, 15 Mar 2024 08:35:33 +0100 Received: from [2a0a:edc0:0:1101:1d::39] (helo=dude03.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rl26G-006SiK-PV; Fri, 15 Mar 2024 08:35:32 +0100 Received: from lgo by dude03.red.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rl26G-00Exww-29; Fri, 15 Mar 2024 08:35:32 +0100 From: =?UTF-8?q?Leonard=20G=C3=B6hrs?= To: distrokit@pengutronix.de Date: Fri, 15 Mar 2024 08:35:28 +0100 Message-Id: <20240315073528.3566983-1-l.goehrs@pengutronix.de> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [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: , Cc: =?UTF-8?q?Leonard=20G=C3=B6hrs?= 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 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 -- 2.39.2