]> code.ossystems Code Review - openembedded-core.git/commitdiff
recipetool: ignore empty license files
authorStefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Fri, 8 Oct 2021 07:48:28 +0000 (09:48 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 14 Oct 2021 10:48:35 +0000 (11:48 +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 893980a5cec1b61c0c11e5c2637b501b121149d7..87b25ebc7e2df24a12abc1ddcbb08d9c47b9a4fe 100644 (file)
@@ -1126,9 +1126,10 @@ def guess_license(srctree, d):
         license = md5sums.get(md5value, None)
         if not license:
             license, crunched_md5, lictext = crunch_license(licfile)
-            if not license:
+            if lictext and not license:
                 license = 'Unknown'
-        licenses.append((license, os.path.relpath(licfile, srctree), md5value))
+        if license:
+            licenses.append((license, os.path.relpath(licfile, srctree), md5value))
 
     # FIXME should we grab at least one source file with a license header and add that too?