Skip to content

Commit c5c5538

Browse files
bulwahngregkh
authored andcommitted
scripts/spdxcheck.py: handle license identifiers in XML comments
Commit cc9539e ("media: docs: use the new SPDX header for GFDL-1.1 on *.svg files") adds SPDX-License-Identifiers enclosed in XML comments, i.e., <!-- ... -->, for svg files. Unfortunately, ./scripts/spdxcheck.py does not handle SPDX-License-Identifiers in XML comments, so it simply fails on checking these files with 'Invalid License ID: --'. Strip the XML comment ending simply by copying how it was done for comments in C. With that, ./scripts/spdxcheck.py handles the svg files properly. Signed-off-by: Lukas Bulwahn <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 5ec4f0c commit c5c5538

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

scripts/spdxcheck.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ def parse_lines(self, fd, maxlines, fname):
180180
# Remove trailing comment closure
181181
if line.strip().endswith('*/'):
182182
expr = expr.rstrip('*/').strip()
183+
# Remove trailing xml comment closure
184+
if line.strip().endswith('-->'):
185+
expr = expr.rstrip('-->').strip()
183186
# Special case for SH magic boot code files
184187
if line.startswith('LIST \"'):
185188
expr = expr.rstrip('\"').strip()

0 commit comments

Comments
 (0)