]> code.ossystems Code Review - openembedded-core.git/commitdiff
recipetool: Simplify common source files skip in guess_license
authorStefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Wed, 20 Oct 2021 07:40:14 +0000 (09:40 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 23 Oct 2021 16:41:46 +0000 (17:41 +0100)
Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/recipetool/create.py

index 3b58d6fa823f4d8922159fb2aa494835f0b241d7..5a267fb57c6497e0f2285124d16002ac3336d41b 100644 (file)
@@ -1188,10 +1188,11 @@ def guess_license(srctree, d):
 
     licenses = []
     licspecs = ['*LICEN[CS]E*', 'COPYING*', '*[Ll]icense*', 'LEGAL*', '[Ll]egal*', '*GPL*', 'README.lic*', 'COPYRIGHT*', '[Cc]opyright*', 'e[dp]l-v10']
+    skip_extensions = (".html", ".js", ".json", ".svg", ".ts")
     licfiles = []
     for root, dirs, files in os.walk(srctree):
         for fn in files:
-            if fn.endswith(".html") or fn.endswith(".js") or fn.endswith(".json") or fn.endswith(".svg") or fn.endswith(".ts"):
+            if fn.endswith(skip_extensions):
                 continue
             for spec in licspecs:
                 if fnmatch.fnmatch(fn, spec):