summaryrefslogtreecommitdiffstats
path: root/meta/classes/utility-tasks.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/utility-tasks.bbclass')
-rw-r--r--meta/classes/utility-tasks.bbclass69
1 files changed, 69 insertions, 0 deletions
diff --git a/meta/classes/utility-tasks.bbclass b/meta/classes/utility-tasks.bbclass
new file mode 100644
index 0000000..1792f18
--- /dev/null
+++ b/meta/classes/utility-tasks.bbclass
@@ -0,0 +1,69 @@
1addtask listtasks
2do_listtasks[nostamp] = "1"
3python do_listtasks() {
4 taskdescs = {}
5 maxlen = 0
6 for e in d.keys():
7 if d.getVarFlag(e, 'task'):
8 maxlen = max(maxlen, len(e))
9 if e.endswith('_setscene'):
10 desc = "%s (setscene version)" % (d.getVarFlag(e[:-9], 'doc') or '')
11 else:
12 desc = d.getVarFlag(e, 'doc') or ''
13 taskdescs[e] = desc
14
15 tasks = sorted(taskdescs.keys())
16 for taskname in tasks:
17 bb.plain("%s %s" % (taskname.ljust(maxlen), taskdescs[taskname]))
18}
19
20CLEANFUNCS ?= ""
21
22T_task-clean = "${LOG_DIR}/cleanlogs/${PN}"
23addtask clean
24do_clean[nostamp] = "1"
25python do_clean() {
26 """clear the build and temp directories"""
27 dir = d.expand("${WORKDIR}")
28 bb.note("Removing " + dir)
29 oe.path.remove(dir)
30
31 dir = "%s.*" % bb.data.expand(d.getVar('STAMP'), d)
32 bb.note("Removing " + dir)
33 oe.path.remove(dir)
34
35 for f in (d.getVar('CLEANFUNCS', True) or '').split():
36 bb.build.exec_func(f, d)
37}
38
39addtask checkuri
40do_checkuri[nostamp] = "1"
41python do_checkuri() {
42 src_uri = (d.getVar('SRC_URI', True) or "").split()
43 if len(src_uri) == 0:
44 return
45
46 localdata = bb.data.createCopy(d)
47 bb.data.update_data(localdata)
48
49 try:
50 fetcher = bb.fetch2.Fetch(src_uri, localdata)
51 fetcher.checkstatus()
52 except bb.fetch2.BBFetchException, e:
53 raise bb.build.FuncFailed(e)
54}
55
56addtask checkuriall after do_checkuri
57do_checkuriall[recrdeptask] = "do_checkuriall do_checkuri"
58do_checkuriall[recideptask] = "do_${BB_DEFAULT_TASK}"
59do_checkuriall[nostamp] = "1"
60do_checkuriall() {
61 :
62}
63
64addtask fetchall after do_fetch
65do_fetchall[recrdeptask] = "do_fetchall do_fetch"
66do_fetchall[recideptask] = "do_${BB_DEFAULT_TASK}"
67do_fetchall() {
68 :
69}