Linux-SPDX Archive on
 help / color / Atom feed
* [PATCH] scripts/ handle license identifiers in XML comments
@ 2020-09-26 19:03 Lukas Bulwahn
  0 siblings, 0 replies; only message in thread
From: Lukas Bulwahn @ 2020-09-26 19:03 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-spdx
  Cc: Thomas Gleixner, linux-kernel, Lukas Bulwahn

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/ 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/ handles the svg files properly.

Signed-off-by: Lukas Bulwahn <>
applies cleanly on current master and next-20200925

Greg, please pick this quick minor patch for your spdx tree. thanks.

 scripts/ | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/scripts/ b/scripts/
index 6374e078a5f2..bc87200f9c7c 100755
--- a/scripts/
+++ b/scripts/
@@ -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()

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-26 19:03 [PATCH] scripts/ handle license identifiers in XML comments Lukas Bulwahn

Linux-SPDX Archive on

Archives are clonable:
	git clone --mirror linux-spdx/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-spdx linux-spdx/ \
	public-inbox-index linux-spdx

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone