]> code.ossystems Code Review - openembedded-core.git/commitdiff
recipetool: fix duplicate licenses being picked up
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Sun, 8 Mar 2015 21:41:18 +0000 (21:41 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 20 Mar 2015 11:03:13 +0000 (11:03 +0000)
If a license file matched more than one of the specifications (e.g.
COPYING.GPL) then it was being added to LIC_FILES_CHKSUM more than once.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/lib/recipetool/create.py

index ae599cbb706c277ad75bcfc2496f6f7191e62cbb..1c71b24bfb5e13d841c9a25f1fce27ee83764238 100644 (file)
@@ -310,7 +310,9 @@ def guess_license(srctree):
         for fn in files:
             for spec in licspecs:
                 if fnmatch.fnmatch(fn, spec):
-                    licfiles.append(os.path.join(root, fn))
+                    fullpath = os.path.join(root, fn)
+                    if not fullpath in licfiles:
+                        licfiles.append(fullpath)
     for licfile in licfiles:
         md5value = bb.utils.md5_file(licfile)
         license = md5sums.get(md5value, 'Unknown')