summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/src_distribute.bbclass43
-rw-r--r--meta/classes/src_distribute_local.bbclass4
2 files changed, 15 insertions, 32 deletions
diff --git a/meta/classes/src_distribute.bbclass b/meta/classes/src_distribute.bbclass
index 5daf526018..157e22bcef 100644
--- a/meta/classes/src_distribute.bbclass
+++ b/meta/classes/src_distribute.bbclass
@@ -1,40 +1,21 @@
1include conf/licenses.conf
2
3SRC_DISTRIBUTECOMMAND[func] = "1" 1SRC_DISTRIBUTECOMMAND[func] = "1"
4python do_distribute_sources () { 2python do_distribute_sources () {
5 l = bb.data.createCopy(d) 3 l = bb.data.createCopy(d)
6 bb.data.update_data(l) 4 bb.data.update_data(l)
7 licenses = (bb.data.getVar('LICENSE', d, 1) or "").split() 5 licenses = (bb.data.getVar('LICENSE', d, 1) or "unknown").split()
8 if not licenses: 6
9 bb.note("LICENSE not defined") 7 sources_dir = bb.data.getVar('SRC_DISTRIBUTEDIR', d, 1)
10 src_distribute_licenses = (bb.data.getVar('SRC_DISTRIBUTE_LICENSES', d, 1) or "").split() 8 import re
11 # Explanation:
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.
19 valid = 1
20 for l in licenses: 9 for l in licenses:
21 lvalid = 0
22 for i in l.split("|"): 10 for i in l.split("|"):
23 if i in src_distribute_licenses: 11 for s in (bb.data.getVar('A', d, 1) or "").split():
24 lvalid = 1 12 s = re.sub(';.*$', '', s)
25 if lvalid != 1: 13 cmd = bb.data.getVar('SRC_DISTRIBUTECOMMAND', d, 1)
26 valid = 0 14 if not cmd:
27 if valid == 0: 15 raise bb.build.FuncFailed("Unable to distribute sources, SRC_DISTRIBUTECOMMAND not defined")
28 bb.note("Licenses (%s) are not all listed in SRC_DISTRIBUTE_LICENSES, skipping source distribution" % licenses) 16 bb.data.setVar('SRC', s, d)
29 return 17 bb.data.setVar('SRC_DISTRIBUTEDIR', "%s/%s" % (sources_dir, l), d)
30 import re 18 bb.build.exec_func('SRC_DISTRIBUTECOMMAND', d)
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)
34 if not cmd:
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)
38} 19}
39 20
40addtask distribute_sources before do_build after do_fetch 21addtask distribute_sources before do_build after do_fetch
diff --git a/meta/classes/src_distribute_local.bbclass b/meta/classes/src_distribute_local.bbclass
index 5f0cef5bec..31cc85fae4 100644
--- a/meta/classes/src_distribute_local.bbclass
+++ b/meta/classes/src_distribute_local.bbclass
@@ -1,3 +1,5 @@
1SRC_DISTRIBUTEDIR ?= "${DEPLOY_DIR}/sources"
2
1inherit src_distribute 3inherit src_distribute
2 4
3# SRC_DIST_LOCAL possible values: 5# SRC_DIST_LOCAL possible values:
@@ -5,7 +7,7 @@ inherit src_distribute
5# symlink symlinks the files from ${A} to the distributedir 7# symlink symlinks the files from ${A} to the distributedir
6# move+symlink moves the files into distributedir, and symlinks them back 8# move+symlink moves the files into distributedir, and symlinks them back
7SRC_DIST_LOCAL ?= "move+symlink" 9SRC_DIST_LOCAL ?= "move+symlink"
8SRC_DISTRIBUTEDIR ?= "${DEPLOY_DIR}/sources" 10
9SRC_DISTRIBUTECOMMAND () { 11SRC_DISTRIBUTECOMMAND () {
10 s="${SRC}" 12 s="${SRC}"
11 if [ ! -L "$s" ] && (echo "$s"|grep "^${DL_DIR}"); then 13 if [ ! -L "$s" ] && (echo "$s"|grep "^${DL_DIR}"); then