1 SRC_DISTRIBUTE_DLONLY ?= "0"
2 SRC_DISTRIBUTECOMMAND[func] = "1"
4 addtask distribute_sources before do_build after do_fetch
5 python do_distribute_sources () {
6 bb.build.exec_func("do_fetch", d)
8 cmd = bb.data.getVar('SRC_DISTRIBUTECOMMAND', d, 1)
10 raise bb.build.FuncFailed("Unable to distribute sources, SRC_DISTRIBUTECOMMAND not set")
13 dlonly = int(d.getVar("SRC_DISTRIBUTE_DLONLY", 1))
15 raise bb.build.FuncFailed("Invalid value for SRC_DISTRIBUTE_DLONLY: expected integer.")
16 dldir = os.path.realpath(d.getVar("DL_DIR", 1) or "")
18 licenses = (bb.data.getVar('LICENSE', d, 1) or "unknown").split()
19 urldatadict = bb.fetch.init(d.getVar("SRC_URI", True).split(), d, True)
20 for url, urldata in urldatadict.iteritems():
22 urldata.setup_localpath(d)
24 local = urldata.localpath
25 if dlonly and dldir and not \
26 os.path.realpath(local).startswith(dldir + os.path.sep):
29 bb.data.setVar('SRC', os.path.abspath(local), d)
30 for license in licenses:
31 for entry in license.split("|"):
32 bb.data.setVar('LIC', entry, d)
33 bb.build.exec_func('SRC_DISTRIBUTECOMMAND', d)
36 addtask distribute_sources_all after do_distribute_sources
37 do_distribute_sources_all[recrdeptask] = "do_distribute_sources"
38 do_distribute_sources_all[nostamp] = "1"
40 # compatability wrapper
41 addtask distsrcall after do_distribute_sources_all
42 do_distsrcall[nostamp] = "1"