mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Ralf Glaser <glaser@iotmaxx.de>
To: ptxdist@pengutronix.de
Cc: Ralf Glaser <glaser@iotmaxx.de>
Subject: [ptxdist] [PATCH] spdx.py: add filesAnalyzed property
Date: Tue,  3 Jun 2025 16:40:24 +0200	[thread overview]
Message-ID: <20250603144249.29071-1-glaser@iotmaxx.de> (raw)

Add boolean filesAnalyzed property without which https://tools.spdx.org/app/validate/
will not recognize the SPDX-SBOM as valid.

Signed-off-by: Ralf Glaser <glaser@iotmaxx.de>
---
 scripts/report/spdx.py | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/scripts/report/spdx.py b/scripts/report/spdx.py
index 96e56af19..f6fc371f8 100644
--- a/scripts/report/spdx.py
+++ b/scripts/report/spdx.py
@@ -64,6 +64,29 @@ class _String(_Property):
     def init(self, source):
         return source
 
+class _Bool(_Property):
+    """
+    A scalar bool property for an SPDX object
+    """
+
+    def __init__(self, **kwargs):
+        super().__init__(**kwargs)
+
+    def set_property(self, attrs, name):
+        def get_helper(obj):
+            return obj._spdx[name]
+
+        def set_helper(obj, value):
+            obj._spdx[name] = value
+
+        def del_helper(obj):
+            del obj._spdx[name]
+
+        attrs[name] = property(get_helper, set_helper, del_helper)
+
+    def init(self, source):
+        return source
+
 
 class _Object(_Property):
     """
@@ -247,6 +270,7 @@ class SPDXPackage(SPDXObject):
     packageFileName = _String()
     annotations = _ObjectList(SPDXAnnotation)
     checksums = _ObjectList(SPDXChecksum)
+    filesAnalyzed = _Bool(default=False)
 
 
 class SPDXFile(SPDXObject):
-- 
2.49.0




                 reply	other threads:[~2025-06-03 14:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250603144249.29071-1-glaser@iotmaxx.de \
    --to=glaser@iotmaxx.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox