From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 27 Jun 2025 08:46:06 +0200 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 1uV2qc-00BXAK-2x for lore@lore.pengutronix.de; Fri, 27 Jun 2025 08:46:06 +0200 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 1uV2qc-0004xz-N0; Fri, 27 Jun 2025 08:46:06 +0200 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 1uV2qH-0004xq-23; Fri, 27 Jun 2025 08:45:45 +0200 Received: from dude05.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::54]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uV2qG-005ZUq-2T; Fri, 27 Jun 2025 08:45:44 +0200 Received: from mol by dude05.red.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1uV2qG-00DLBf-2J; Fri, 27 Jun 2025 08:45:44 +0200 Date: Fri, 27 Jun 2025 08:45:44 +0200 From: Michael Olbrich To: Ralf Glaser Message-ID: References: <20250603144249.29071-1-glaser@iotmaxx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250603144249.29071-1-glaser@iotmaxx.de> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain Subject: Re: [ptxdist] [PATCH] spdx.py: add filesAnalyzed property X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: ptxdist@pengutronix.de Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false On Tue, Jun 03, 2025 at 04:40:24PM +0200, Ralf Glaser wrote: > Add boolean filesAnalyzed property without which https://tools.spdx.org/app/validate/ > will not recognize the SPDX-SBOM as valid. Hmm, that is strange. If I read the spec[1] correctly then this property is optional. And setting it to false seems incorrect as well: "If set to false, the package must not contain any files." Michael [1] https://spdx.org/rdf/spdx-terms-v2.3/#d4e2963 > Signed-off-by: Ralf Glaser > --- > 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 > > > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |