aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/spdxcheck.py
diff options
context:
space:
mode:
authorThomas Gleixner <[email protected]>2024-11-29 10:37:45 +0000
committerGreg Kroah-Hartman <[email protected]>2025-01-08 14:38:28 +0000
commit634d34e856ca0123f96613ffaf1852a1d3b46880 (patch)
tree546f2e4aa3985024720f312ecd7da9a660ad860b /scripts/spdxcheck.py
parentntsync: No longer depend on BROKEN. (diff)
downloadkernel-634d34e856ca0123f96613ffaf1852a1d3b46880.tar.gz
kernel-634d34e856ca0123f96613ffaf1852a1d3b46880.zip
scripts/spdxcheck: Parse j2 comments correctly
j2 files use '#}' as comment closure, which trips up the SPDX parser: tools/.../definition.j2: 1:36 Invalid token: #} Handle those comments correctly by removing the closure. Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/878qt2xr46.ffs@tglx Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'scripts/spdxcheck.py')
-rwxr-xr-xscripts/spdxcheck.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/spdxcheck.py b/scripts/spdxcheck.py
index 8b8fb115fc81..fe57c9aecf37 100755
--- a/scripts/spdxcheck.py
+++ b/scripts/spdxcheck.py
@@ -217,6 +217,9 @@ class id_parser(object):
# Special case for SH magic boot code files
if line.startswith('LIST \"'):
expr = expr.rstrip('\"').strip()
+ # Remove j2 comment closure
+ if line.startswith('{#'):
+ expr = expr.rstrip('#}').strip()
self.parse(expr)
self.spdx_valid += 1
#