From patchwork Mon Nov 25 11:56:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis OSTERLAND-HEIM X-Patchwork-Id: 53103 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 463F2D5806C for ; Mon, 25 Nov 2024 11:56:43 +0000 (UTC) Received: from enterprise01.smtp.diehl.com (enterprise01.smtp.diehl.com [193.201.238.219]) by mx.groups.io with SMTP id smtpd.web11.17119.1732535801933737590 for ; Mon, 25 Nov 2024 03:56:42 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@diehl.com header.s=default header.b=LkyqVzww; spf=pass (domain: diehl.com, ip: 193.201.238.219, mailfrom: prvs=052d57505=denis.osterland@diehl.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=diehl.com; i=@diehl.com; q=dns/txt; s=default; t=1732535802; x=1764071802; h=from:to:subject:date:message-id:mime-version; bh=qBJReiSGRXKFlfVwO88k5ZaULGiVDywTbZ9GWrXyNAk=; b=LkyqVzwwGE33oVLxa10xiRa+egK7mbOcZkqkzZ4H8kGvrWoyxGI8mVm+ gg4dzIRqEKZsRgL2Z+lOTc10kXqpTVMc311wh2Z9khMOzNUlkis8z9T4I upBMm0WrPJIDOVn3iNHGfFsI6yYZJP3DJ4kJHhXiFghudz7tK3EV/3qF8 fGO7KsJMmjtY2YsqpFZyEtGFTIG3J9u72RPB/xAO3GbIl+IxUm4Bzw9ia WG17OXV/Wf5V/VQetR5Pq0SQC85cX6tBvezafE456YuHMxqQfaotXdeZx XrcH3G+eWaigcauOtYctdBWlGTcIn9bRLYtuh56+5Cd6C7td+wgH2xEio g==; X-CSE-ConnectionGUID: S1tfQiCGT9OtlVeWDDeJUA== X-CS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FPlWLrGLtCgeN0rsw47TODfJb83hSI6OW5XVGKT4sdE3qfb/9suctopy2Qq b6zLfCizA1SVuD7aCTb/YMfaFsNN3UTAZHtt9cRcfaOJAdjEmwtB/Ldh7Q7dORYc799z7+Or iv7Ax8ekQGl7ZHaFTi3hrlYQOuHdf5CQbgTZ0TA4X7AN6AfXLuS IronPort-HdrOrdr: A9a23:z6P2xaNFD1kz28BcTq6jsMiBIKoaSvp037BL7SBMoHNuGPBw+/ rCoB15737JYVQqN03I8OroUMK9qBjnm6Kdj7N8AYuf X-Talos-CUID: 9a23:SVBNY20ieLZvX8f1+Z5RTLxfIZk5fETc51jscmikDVhkd5G5RH2t0fYx X-Talos-MUID: 9a23:PleFHg6li7mBvvgZVy2jM1Scxow4s52oD1ENvqxZnPCrKipMIxS8nTWoF9o= X-IronPort-AV: E=Sophos;i="6.12,182,1728943200"; d="p7s'346?scan'346,208,346";a="105747847" From: Denis OSTERLAND-HEIM To: "openembedded-core@lists.openembedded.org" Subject: [PATCH 2/3] spdx: add support for WITH operator Date: Mon, 25 Nov 2024 12:56:40 +0100 (CET) Message-ID: 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, 25 Nov 2024 11:56:43 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/207745 Adds the + operator for use in LICENSE field. It is replaced by SPDX WITH operator. Signed-off-by: Denis Osterland-Heim --- meta/lib/oe/license.py | 4 ++-- meta/lib/oe/spdx30_tasks.py | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) spdx_license_expression = " ".join(convert(l) for l in lic_split) -- 2.45.2 diff --git a/meta/lib/oe/license.py b/meta/lib/oe/license.py index 3c15db782f..223f98acd5 100644 --- a/meta/lib/oe/license.py +++ b/meta/lib/oe/license.py @@ -47,9 +47,9 @@ class InvalidLicense(LicenseError): def __str__(self): return "invalid characters in license '%s'" % self.license -license_operator_chars = '&|() ' +license_operator_chars = '&|()+ ' license_operator = re.compile(r'([' + license_operator_chars + '])') -license_pattern = re.compile(r'[a-zA-Z0-9.+_\-]+$') +license_pattern = re.compile(r'[a-zA-Z0-9._\-]+$') class LicenseVisitor(ast.NodeVisitor): """Get elements based on OpenEmbedded license strings""" diff --git a/meta/lib/oe/spdx30_tasks.py b/meta/lib/oe/spdx30_tasks.py index 5aeed5cd6f..17a1ce44e7 100644 --- a/meta/lib/oe/spdx30_tasks.py +++ b/meta/lib/oe/spdx30_tasks.py @@ -97,6 +97,9 @@ def add_license_expression(d, objset, license_expression, license_data): if l == "|": return "OR" + if l == "+": + return "WITH" + if l == "CLOSED": return "NONE" @@ -115,6 +118,7 @@ def add_license_expression(d, objset, license_expression, license_data): .replace(")", " ) ") .replace("|", " | ") .replace("&", " & ") + .replace("+", " + ") .split() )