From bdf2d94c35b7e5ed1723f987696a6c865bff212c Mon Sep 17 00:00:00 2001 From: Elizabeth Flanagan Date: Fri, 23 Mar 2012 16:51:42 -0700 Subject: INCOMPATIBLE_LICENSE: support for spdx and pkg licenses This adds a few things to the incompatible license functionality 1. INCOMPATIBLE_LICENSE was unable to distinguish any variation within LICENSE (e.g. GPLv3 v. GPLv3.0). This now utilizes the SPDXLICENSEMAP of the license indicated as INCOMPATIBLE_LICENSE 2. Given a recipe where the main LICENSE was incompatible but a package of the recipe was compatible, the entire recipe would be excluded. This allows us some finer grained control over what exactly gets excluded. (From OE-Core rev: a8d7246f7b13ef2636c325263c8bfa22552d7a57) Signed-off-by: Elizabeth Flanagan Signed-off-by: Richard Purdie --- meta/classes/package.bbclass | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'meta/classes/package.bbclass') diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass index bdc4d37af6..20af8b7914 100644 --- a/meta/classes/package.bbclass +++ b/meta/classes/package.bbclass @@ -887,15 +887,20 @@ python populate_packages () { bb.mkdirhier(outdir) os.chdir(dvar) - # Sanity check PACKAGES for duplicates - should be moved to - # sanity.bbclass once we have the infrastucture + # Sanity check PACKAGES for duplicates and for LICENSE_EXCLUSION + # Sanity should be moved to sanity.bbclass once we have the infrastucture package_list = [] + for pkg in packages.split(): - if pkg in package_list: - bb.error("%s is listed in PACKAGES multiple times, this leads to packaging errors." % pkg) + if d.getVar('LICENSE_EXCLUSION-' + pkg, True): + bb.warn("%s has an incompatible license. Excluding from packaging." % pkg) + packages.remove(pkg) else: - package_list.append(pkg) - + if pkg in package_list: + bb.error("%s is listed in PACKAGES multiple times, this leads to packaging errors." % pkg) + else: + package_list.append(pkg) + d.setVar('PACKAGES', ' '.join(package_list)) pkgdest = d.getVar('PKGDEST', True) os.system('rm -rf %s' % pkgdest) -- cgit v1.2.3-54-g00ecf