]> code.ossystems Code Review - openembedded-core.git/commit
license: improve handling of license files with identical basenames
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Fri, 5 Aug 2016 10:23:52 +0000 (13:23 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 10 Aug 2016 09:45:32 +0000 (10:45 +0100)
commitd5e1375884e509ec745bac43f1f7f7950f62f280
treea8f7021277bc5864a603cc78ed361605944b21de
parent91d9f3271c12fb755ab332637b17650d5fe75ce2
license: improve handling of license files with identical basenames

Previously, find_license_files() in license.bbclass just blindly assumed
that all different licenses specified in LIC_FILES_CHKSUM have unique
filenames. As a consequence, only the last one of these similarly named
license files was copied and the rest were "lost". This patch changes
the behavior so that all license files get copied. However, if multiple
identically named files are found, they are renamed to <file>.0,
<file>.1 etc.

The patch also changes the handling of NO_GENERIC_LICENSE slightly.
Previously, only basenames of NO_GENERIC_LICENSE and LIC_FILES_CHKSUM
were compared when searching for the correct license file. After this
patch NO_GENERIC_LICENSE must have the full path, matching what is
specified in LIC_FILES_CHKSUM. This is required in order to be able
to handle identical filenames (basenames) consistently. For example, if
you have:
LICENSE = "my-custom-license"
LIC_FILES_CHKSUM = "file://src/LICENCE;md5=d41d8cd98f00b204e9800998ecf8427e"

you must specify:
NO_GENERIC_LICENSE[my-custom-license] = "src/LICENCE"

[YOCTO #9663]

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
meta/classes/license.bbclass