diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2019-01-16 05:26:53 -0500 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2019-01-16 16:54:51 -0500 |
commit | 959b49687838c9eae38f19cb19d504ba880b6cd0 (patch) | |
tree | 88d43f84a0529f491a78b47c1e2af68a7a12288b /scripts/spdxcheck.py | |
parent | 6e6c61d3e342ee0830844b1ce3d433decfc2321e (diff) |
scripts/spdxcheck.py: Handle special quotation mark comments
The SuperH boot code files use a magic format for the SPDX identifier
comment:
LIST "SPDX-License-Identifier: .... "
The trailing quotation mark is not stripped before the token parser is
invoked and causes the scan to fail. Handle it gracefully.
Fixes: 6a0abce4c4cc ("sh: include: convert to SPDX identifiers")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Simon Horman <horms+renesas@verge.net.au>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'scripts/spdxcheck.py')
-rwxr-xr-x | scripts/spdxcheck.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/spdxcheck.py b/scripts/spdxcheck.py index e559c6294c39..3fb020c2cb7f 100755 --- a/scripts/spdxcheck.py +++ b/scripts/spdxcheck.py | |||
@@ -175,7 +175,13 @@ class id_parser(object): | |||
175 | self.lines_checked += 1 | 175 | self.lines_checked += 1 |
176 | if line.find("SPDX-License-Identifier:") < 0: | 176 | if line.find("SPDX-License-Identifier:") < 0: |
177 | continue | 177 | continue |
178 | expr = line.split(':')[1].replace('*/', '').strip() | 178 | expr = line.split(':')[1].strip() |
179 | # Remove trailing comment closure | ||
180 | if line.startswith('/*'): | ||
181 | expr = expr.rstrip('*/').strip() | ||
182 | # Special case for SH magic boot code files | ||
183 | if line.startswith('LIST \"'): | ||
184 | expr = expr.rstrip('\"').strip() | ||
179 | self.parse(expr) | 185 | self.parse(expr) |
180 | self.spdx_valid += 1 | 186 | self.spdx_valid += 1 |
181 | # | 187 | # |