aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/spdxcheck.py
diff options
context:
space:
mode:
authorThomas Gleixner <[email protected]>2019-01-16 10:26:53 +0000
committerJonathan Corbet <[email protected]>2019-01-16 21:54:51 +0000
commit959b49687838c9eae38f19cb19d504ba880b6cd0 (patch)
tree88d43f84a0529f491a78b47c1e2af68a7a12288b /scripts/spdxcheck.py
parentLICENSES: Add GCC runtime library exception text (diff)
downloadkernel-959b49687838c9eae38f19cb19d504ba880b6cd0.tar.gz
kernel-959b49687838c9eae38f19cb19d504ba880b6cd0.zip
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 <[email protected]> Cc: Kuninori Morimoto <[email protected]> Cc: Simon Horman <[email protected]> Cc: Yoshinori Sato <[email protected]> Cc: Rich Felker <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Kate Stewart <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Jonathan Corbet <[email protected]>
Diffstat (limited to 'scripts/spdxcheck.py')
-rwxr-xr-xscripts/spdxcheck.py8
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):
self.lines_checked += 1
if line.find("SPDX-License-Identifier:") < 0:
continue
- expr = line.split(':')[1].replace('*/', '').strip()
+ expr = line.split(':')[1].strip()
+ # Remove trailing comment closure
+ if line.startswith('/*'):
+ expr = expr.rstrip('*/').strip()
+ # Special case for SH magic boot code files
+ if line.startswith('LIST \"'):
+ expr = expr.rstrip('\"').strip()
self.parse(expr)
self.spdx_valid += 1
#