Răsfoiți Sursa

scripts/spdxcheck.py: handle license identifiers in XML comments

Commit cc9539e7884c ("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]>
Lukas Bulwahn 4 ani în urmă
părinte
comite
c5c5538508
1 a modificat fișierele cu 3 adăugiri și 0 ștergeri
  1. 3 0
      scripts/spdxcheck.py

+ 3 - 0
scripts/spdxcheck.py

@@ -180,6 +180,9 @@ class id_parser(object):
                 # Remove trailing comment closure
                 if line.strip().endswith('*/'):
                     expr = expr.rstrip('*/').strip()
+                # Remove trailing xml comment closure
+                if line.strip().endswith('-->'):
+                    expr = expr.rstrip('-->').strip()
                 # Special case for SH magic boot code files
                 if line.startswith('LIST \"'):
                     expr = expr.rstrip('\"').strip()