scripts/spdxcheck.py: work with current HEAD LICENSES/ directory
authorJoe Perches <[email protected]>
Fri, 17 Aug 2018 22:43:57 +0000 (15:43 -0700)
committerLinus Torvalds <[email protected]>
Fri, 17 Aug 2018 23:20:27 +0000 (16:20 -0700)
Depending on how old your -next tree is, it may not have a master that
has the LICENSES directory.

Change the lookup to HEAD and find whatever LICENSE directory files are
used in that branch.

Miscellanea:

 - Remove the checkpatch test as it will have its own SPDX license
   identifier.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Joe Perches <[email protected]>
Reviewed-by: Thomas Gleixner <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
scripts/spdxcheck.py

index 7deaef297f529d30a090ea671fa503f5565639fe..a6041f29b18e403213f2e6b67adffe4de0be0e7c 100755 (executable)
@@ -32,7 +32,7 @@ def read_spdxdata(repo):
 
     # The subdirectories of LICENSES in the kernel source
     license_dirs = [ "preferred", "other", "exceptions" ]
-    lictree = repo.heads.master.commit.tree['LICENSES']
+    lictree = repo.head.commit.tree['LICENSES']
 
     spdx = SPDXdata()
 
@@ -199,8 +199,6 @@ def scan_git_tree(tree):
             continue
         if el.path.find("license-rules.rst") >= 0:
             continue
-        if el.path == 'scripts/checkpatch.pl':
-            continue
         if not os.path.isfile(el.path):
             continue
         parser.parse_lines(open(el.path), args.maxlines, el.path)