From patchwork Mon Nov 22 08:34:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mittal, Anuj" X-Patchwork-Id: 292 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8CBDC433EF for ; Mon, 22 Nov 2021 08:34:27 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web11.3862.1637570053453876204 for ; Mon, 22 Nov 2021 00:34:21 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: anuj.mittal@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10175"; a="232232003" X-IronPort-AV: E=Sophos;i="5.87,254,1631602800"; d="scan'208";a="232232003" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2021 00:34:20 -0800 X-IronPort-AV: E=Sophos;i="5.87,254,1631602800"; d="scan'208";a="508448624" Received: from amohdwah-mobl1.gar.corp.intel.com (HELO anmitta2-mobl3.intel.com) ([10.215.239.176]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2021 00:34:19 -0800 From: Anuj Mittal To: openembedded-core@lists.openembedded.org Subject: [honister][PATCH 5/5] create-spdx: Fix key errors in do_create_runtime_spdx Date: Mon, 22 Nov 2021 16:34:06 +0800 Message-Id: X-Mailer: git-send-email 2.33.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 22 Nov 2021 08:34:27 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/158559 From: Andres Beltran Currently, the do_create_runtime_spdx task fails with a Key Error if a dependency is not contained in the package providers dictionary. Add a check before using "dep" as a key in "providers". Signed-off-by: Andres Beltran Signed-off-by: Richard Purdie (cherry picked from commit 140ce5ef5e8f10251091660e3ef76f315f409076) Signed-off-by: Anuj Mittal --- meta/classes/create-spdx.bbclass | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta/classes/create-spdx.bbclass b/meta/classes/create-spdx.bbclass index d0cc5b1ca2..0a4db80aba 100644 --- a/meta/classes/create-spdx.bbclass +++ b/meta/classes/create-spdx.bbclass @@ -675,6 +675,9 @@ python do_create_runtime_spdx() { if dep in seen_deps: continue + if dep not in providers: + continue + dep = providers[dep] if not oe.packagedata.packaged(dep, localdata):