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 () {
8 bb.build.exec_func("do_fetch", d)
10 l = bb.data.createCopy(d)
11 bb.data.update_data(l)
13 licenses = (bb.data.getVar('LICENSE', d, 1) or "unknown").split()
14 for license in licenses:
15 for entry in license.split("|"):
16 for url in ((bb.data.getVar('SRC_URI', d, 1) or '').split()):
17 bb.fetch.init([url], d)
18 s = bb.fetch.localpath(url, d)
19 s = re.sub(';.*$', '', s)
22 dlonly = int(d.getVar("SRC_DISTRIBUTE_DLONLY", 1))
24 raise bb.build.FuncFailed("Invalid value for SRC_DISTRIBUTE_DLONLY: expected integer.")
26 dldir = os.path.realpath(d.getVar("DL_DIR", 1) or "")
28 os.path.realpath(s).startswith(dldir + os.path.sep):
31 cmd = bb.data.getVar('SRC_DISTRIBUTECOMMAND', d, 1)
33 raise bb.build.FuncFailed("Unable to distribute sources, SRC_DISTRIBUTECOMMAND not set")
34 bb.debug(2, "srcdist: running %s" % cmd)
35 bb.data.setVar('SRC', os.path.normpath(s), l)
36 bb.data.setVar('LIC', entry, l)
37 bb.build.exec_func('SRC_DISTRIBUTECOMMAND', l)
40 addtask distribute_sources_all after do_distribute_sources
41 do_distribute_sources_all[recrdeptask] = "do_distribute_sources"
42 do_distribute_sources_all[nostamp] = "1"
44 # compatability wrapper
45 addtask distsrcall after do_distribute_sources_all
46 do_distsrcall[nostamp] = "1"