scripts/spdxcheck.py: Handle special quotation mark comments
[sfrench/cifs-2.6.git] / scripts / spdxcheck.py
index e559c6294c39aef2819637125520a0721b14a95d..3fb020c2cb7f8803a342ce1eac28a7f88729f9c2 100755 (executable)
@@ -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
                 #