1 include conf/licenses.conf
3 SRC_DISTRIBUTECOMMAND[func] = "1"
4 python do_distribute_sources () {
5 l = bb.data.createCopy(d)
7 licenses = (bb.data.getVar('LICENSE', d, 1) or "").split()
9 bb.note("LICENSE not defined")
10 src_distribute_licenses = (bb.data.getVar('SRC_DISTRIBUTE_LICENSES', d, 1) or "").split()
12 # Space seperated items in LICENSE must *all* be distributable
13 # Each space seperated item may be used under any number of | seperated licenses.
14 # If any of those | seperated licenses are distributable, then that component is.
15 # i.e. LICENSE = "GPL LGPL"
16 # In this case, both components are distributable.
17 # LICENSE = "GPL|QPL|Proprietary"
18 # In this case, GPL is distributable, so the component is.
22 for i in l.split("|"):
23 if i in src_distribute_licenses:
28 bb.note("Licenses (%s) are not all listed in SRC_DISTRIBUTE_LICENSES, skipping source distribution" % licenses)
31 for s in (bb.data.getVar('A', d, 1) or "").split():
32 s = re.sub(';.*$', '', s)
33 cmd = bb.data.getVar('SRC_DISTRIBUTECOMMAND', d, 1)
35 raise bb.build.FuncFailed("Unable to distribute sources, SRC_DISTRIBUTECOMMAND not defined")
36 bb.data.setVar('SRC', s, d)
37 bb.build.exec_func('SRC_DISTRIBUTECOMMAND', d)
40 addtask distribute_sources before do_build after do_fetch