[PATCH v3 3/7] scripts/sbom: skip make_prereqs lines when parsing .cmd files
From: Luis Augenstein
Date: Mon Oct 12 2026 - 17:34:12 EST
kbuild will record the prerequisites of a target in a new
make_prereqs_<target> field in .cmd files. Skip such lines so the
parser keeps working once the field is introduced.
Assisted-by: LLM
Co-developed-by: Maximilian Huber <maximilian.huber@xxxxxxxxxxx>
Signed-off-by: Maximilian Huber <maximilian.huber@xxxxxxxxxxx>
Signed-off-by: Luis Augenstein <luis.augenstein@xxxxxxxxxxx>
---
scripts/sbom/sbom/cmd_graph/cmd_file.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/scripts/sbom/sbom/cmd_graph/cmd_file.py b/scripts/sbom/sbom/cmd_graph/cmd_file.py
index dcd63e284a3..08819b4d117 100644
--- a/scripts/sbom/sbom/cmd_graph/cmd_file.py
+++ b/scripts/sbom/sbom/cmd_graph/cmd_file.py
@@ -50,6 +50,10 @@ class CmdFile:
with open(cmd_file_path, "rt", encoding="utf-8") as f:
lines = [line.strip() for line in f.readlines() if line.strip() != "" and not line.startswith("#")]
+ # make_prereqs_* is recorded for future use. Ignore it for now to
+ # preserve the existing parser behavior.
+ lines = [line for line in lines if not line.startswith("make_prereqs_")]
+
# savedcmd
match = SAVEDCMD_PATTERN.match(lines[0] if lines else "")
if match is None:
--
2.43.0