summaryrefslogtreecommitdiff
path: root/meta/classes/archiver.bbclass
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2014-03-24 13:39:26 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-03-24 10:18:25 +0000
commit0e798d5cbcf585535e19633828dc540a282261fc (patch)
treedab0ec291c1fe011423347aa2728b2b02b976284 /meta/classes/archiver.bbclass
parent312ca574e62cb0ac5fdad4943d7ff9d457caf8e3 (diff)
downloadopenembedded-core-0e798d5cbcf585535e19633828dc540a282261fc.tar.gz
openembedded-core-0e798d5cbcf585535e19633828dc540a282261fc.tar.bz2
openembedded-core-0e798d5cbcf585535e19633828dc540a282261fc.zip
archiver.bbclass: make it can filter the license
* Filter the license (default: no), the recipe whose license in COPYLEFT_LICENSE_INCLUDE will be included, and in COPYLEFT_LICENSE_EXCLUDE will be excluded. * The user can set the recipe type that would be archived (native, target, and so on), deafult to all. The copyleft_filter.bbclass is come from copyleft_compliance.bbclass, which is used by both copyleft_compliance.bbclass and archiver.bbclass. [YOCTO #5740] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/archiver.bbclass')
-rw-r--r--meta/classes/archiver.bbclass27
1 files changed, 25 insertions, 2 deletions
diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index 7780c71ade..9aa9335b94 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -12,9 +12,23 @@
# 5) The environment data, similar to 'bitbake -e recipe':
# ARCHIVER_MODE[dumpdata] = "1"
# 6) The recipe (.bb and .inc): ARCHIVER_MODE[recipe] = "1"
+# 7) Whether output the .src.rpm package:
+# ARCHIVER_MODE[srpm] = "1"
+# 8) Filter the license, the recipe whose license in
+# COPYLEFT_LICENSE_INCLUDE will be included, and in
+# COPYLEFT_LICENSE_EXCLUDE will be excluded.
+# COPYLEFT_LICENSE_INCLUDE = 'GPL* LGPL*'
+# COPYLEFT_LICENSE_EXCLUDE = 'CLOSED Proprietary'
+# 9) The recipe type that will be archived:
+# COPYLEFT_RECIPE_TYPES = 'target'
#
-# All of the above can be packed into a .src.rpm package: (when PACKAGES != "")
-# ARCHIVER_MODE[srpm] = "1"
+
+# Don't filter the license by default
+COPYLEFT_LICENSE_INCLUDE ?= ''
+COPYLEFT_LICENSE_EXCLUDE ?= ''
+# Create archive for all the recipe types
+COPYLEFT_RECIPE_TYPES ?= 'target native nativesdk cross crosssdk cross-canadian'
+inherit copyleft_filter
ARCHIVER_MODE[srpm] ?= "0"
ARCHIVER_MODE[src] ?= "patched"
@@ -38,6 +52,15 @@ do_ar_original[dirs] = "${ARCHIVER_OUTDIR} ${ARCHIVER_WORKDIR}"
python () {
pn = d.getVar('PN', True)
+ if d.getVar('COPYLEFT_LICENSE_INCLUDE', True) or \
+ d.getVar('COPYLEFT_LICENSE_EXCLUDE', True):
+ included, reason = copyleft_should_include(d)
+ if not included:
+ bb.debug(1, 'archiver: %s is excluded: %s' % (pn, reason))
+ return
+ else:
+ bb.debug(1, 'archiver: %s is included: %s' % (pn, reason))
+
ar_src = d.getVarFlag('ARCHIVER_MODE', 'src', True)
ar_dumpdata = d.getVarFlag('ARCHIVER_MODE', 'dumpdata', True)
ar_recipe = d.getVarFlag('ARCHIVER_MODE', 'recipe', True)