summaryrefslogtreecommitdiffstats
path: root/meta/classes/base.bbclass
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2016-08-03 16:32:15 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-25 22:54:49 +0100
commit988f77af3eaf49692bbd456bfe692c507dfa5fbe (patch)
treed40c0541970def3e888910bd96e87758d89b2ca0 /meta/classes/base.bbclass
parent831e98325195f5631b977365fd61c3910a2c23a5 (diff)
downloadpoky-988f77af3eaf49692bbd456bfe692c507dfa5fbe.tar.gz
license: simple verification of LICENSE_<pkg> values
LICENSE should be a superset of all LICENSE_<pkg> values. That is, LICENSE should contain all licenses and LICENSE_<pkg> can be used to "filter" this on a per-package basis. LICENSE_<pkg> shouldn't contain anything that isn't specified in LICENSE. This patch implements simple checking of LICENSE_<pkg> values. It does do not do advanced parsing/matching of license expressions, but, checks that all licenses mentioned in LICENSE_<pkg> are also specified in LICENSE. A warning is printed if problems are found. (From OE-Core rev: 0f4163a12ea431d0ba6265880ee1e557333d3211) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/base.bbclass')
-rw-r--r--meta/classes/base.bbclass13
1 files changed, 13 insertions, 0 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index f2e3d4092e..79edfe5451 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -543,6 +543,19 @@ python () {
543 if pn in incompatwl: 543 if pn in incompatwl:
544 bb.note("INCLUDING " + pn + " as buildable despite INCOMPATIBLE_LICENSE because it has been whitelisted") 544 bb.note("INCLUDING " + pn + " as buildable despite INCOMPATIBLE_LICENSE because it has been whitelisted")
545 545
546 # Try to verify per-package (LICENSE_<pkg>) values. LICENSE should be a
547 # superset of all per-package licenses. We do not do advanced (pattern)
548 # matching of license expressions - just check that all license strings
549 # in LICENSE_<pkg> are found in LICENSE.
550 license_set = oe.license.list_licenses(license)
551 for pkg in d.getVar('PACKAGES', True).split():
552 pkg_license = d.getVar('LICENSE_' + pkg, True)
553 if pkg_license:
554 unlisted = oe.license.list_licenses(pkg_license) - license_set
555 if unlisted:
556 bb.warn("LICENSE_%s includes licenses (%s) that are not "
557 "listed in LICENSE" % (pkg, ' '.join(unlisted)))
558
546 needsrcrev = False 559 needsrcrev = False
547 srcuri = d.getVar('SRC_URI', True) 560 srcuri = d.getVar('SRC_URI', True)
548 for uri in srcuri.split(): 561 for uri in srcuri.split():