path: root/scripts/
diff options
authorVincenzo Frascino <>2019-05-31 22:30:45 -0700
committerLinus Torvalds <>2019-06-01 15:51:31 -0700
commit8d7a7abfc6b42621adc070c7c29b013d7727ed6f (patch)
tree4820c3c3900c25b41cd00f590e755681f7216f6c /scripts/
parent0600597c854e53d2f9b7a6a718c1da2b8b4cb4db (diff) fix directory structures
The LICENSE directory has recently changed structure and this makes spdxcheck fails as per below: FAIL: "Blob or Tree named 'other' not found" Traceback (most recent call last): File "scripts/", line 240, in <module> spdx = read_spdxdata(repo) File "scripts/", line 41, in read_spdxdata for el in lictree[d].traverse(): [...] KeyError: "Blob or Tree named 'other' not found" Fix the script to restore the correctness on checkpatch License checking. References: 62be257e986d ("LICENSES: Rename other to deprecated") References: 8ea8814fcdcb ("LICENSES: Clearly mark dual license only licenses") Link: Signed-off-by: Vincenzo Frascino <> Cc: Joe Perches <> Cc: Christoph Hellwig <> Cc: Thomas Gleixner <> Cc: Jeremy Cline <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'scripts/')
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/ b/scripts/
index 33df646618e2..6374e078a5f2 100755
--- a/scripts/
+++ b/scripts/
@@ -32,7 +32,8 @@ class SPDXdata(object):
def read_spdxdata(repo):
# The subdirectories of LICENSES in the kernel source
- license_dirs = [ "preferred", "deprecated", "exceptions", "dual" ]
+ # Note: exceptions needs to be parsed as last directory.
+ license_dirs = [ "preferred", "dual", "deprecated", "exceptions" ]
lictree = repo.head.commit.tree['LICENSES']
spdx = SPDXdata()
@@ -58,13 +59,13 @@ def read_spdxdata(repo):
elif l.startswith('SPDX-Licenses:'):
for lic in l.split(':')[1].upper().strip().replace(' ', '').replace('\t', '').split(','):
if not lic in spdx.licenses:
- raise SPDXException(None, 'Exception %s missing license %s' %(ex, lic))
+ raise SPDXException(None, 'Exception %s missing license %s' %(exception, lic))
elif l.startswith("License-Text:"):
if exception:
if not len(spdx.exceptions[exception]):
- raise SPDXException(el, 'Exception %s is missing SPDX-Licenses' %excid)
+ raise SPDXException(el, 'Exception %s is missing SPDX-Licenses' %exception)
spdx.exception_files += 1
spdx.license_files += 1