]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.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:46:32 +0000 (10:46 +0100)
commita48fea275b08ff3d3dfc9a928aeb04768db35873
treea3dd7d5735ba0cab24ad6b7f87cbcfbfe5aac6ed
parentda72327ab03cbbb72ce999a167e7e3b4b4aa736a
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]

(From OE-Core rev: d5e1375884e509ec745bac43f1f7f7950f62f280)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/license.bbclass