merge of '6c9b3832ef2260eb1b3a74e74b1d73166ab79d89'
[vuplus_openembedded] / classes / src_distribute.bbclass
1 SRC_DISTRIBUTECOMMAND[func] = "1"
2 python do_distribute_sources () {
3         l = bb.data.createCopy(d)
4         bb.data.update_data(l)
5         licenses = (bb.data.getVar('LICENSE', d, 1) or "unknown").split()
6
7         sources_dir = bb.data.getVar('SRC_DISTRIBUTEDIR', d, 1)
8         import re
9         for license in licenses:
10                 for entry in license.split("|"):
11                         for s in (bb.data.getVar('A', d, 1) or "").split():
12                                 s = re.sub(';.*$', '', s)
13                                 cmd = bb.data.getVar('SRC_DISTRIBUTECOMMAND', d, 1)
14                                 if not cmd:
15                                         raise bb.build.FuncFailed("Unable to distribute sources, SRC_DISTRIBUTECOMMAND not defined")
16                                 bb.data.setVar('SRC', s, d)
17                                 bb.data.setVar('SRC_DISTRIBUTEDIR', "%s/%s" % (sources_dir, entry), d)
18                                 bb.build.exec_func('SRC_DISTRIBUTECOMMAND', d)
19 }
20
21 addtask distribute_sources before do_build after do_fetch
22
23 addtask distsrcall after do_distribute_sources
24 do_distall[recrdeptask] = "do_distribute_sources"
25 base_do_distsrcall() {
26         :
27 }