From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Thu, 06 Nov 2025 12:26:34 +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 1vGy8Q-00FvES-2f for lore@lore.pengutronix.de; Thu, 06 Nov 2025 12:26:34 +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 1vGy8Q-0008GL-Lc; Thu, 06 Nov 2025 12:26:34 +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 1vGy87-0008GC-TX for ptxdist@pengutronix.de; Thu, 06 Nov 2025 12:26:15 +0100 Received: from dude04.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::ac]) 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 1vGy87-007Lte-2K for ptxdist@pengutronix.de; Thu, 06 Nov 2025 12:26:15 +0100 Received: from localhost ([::1] helo=dude04.red.stw.pengutronix.de) by dude04.red.stw.pengutronix.de with esmtp (Exim 4.98.2) (envelope-from ) id 1vGy87-00000009pRX-2bUQ for ptxdist@pengutronix.de; Thu, 06 Nov 2025 12:26:15 +0100 From: Michael Grzeschik To: ptxdist@pengutronix.de Date: Thu, 6 Nov 2025 12:26:04 +0100 Message-ID: <20251106112614.2342635-1-m.grzeschik@pengutronix.de> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [ptxdist] [PATCH] report/sbom.py: ignore parameters for patches in series files 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 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 It is possible to have a parameter for patches in series files like e.g. "-p0". This case will not work when parsing the patches when generating the sbom, since the whole string is taken to check in the path.exists check. If the patch has parameters we skip those and only check for the file which is always set first. Signed-off-by: Michael Grzeschik --- scripts/report/sbom.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/report/sbom.py b/scripts/report/sbom.py index 17acbe5e8..576197ce0 100644 --- a/scripts/report/sbom.py +++ b/scripts/report/sbom.py @@ -88,6 +88,8 @@ class SbomGenerator(Generator): tag = m.group(1) if line.startswith('#'): continue + if len(line.split()) > 1: + line = line.split()[0] patch = path.join(patch_dir, line.rstrip()) if not path.exists(patch): raise ReportException( -- 2.47.3