diff options
Diffstat (limited to 'meta/classes/utility-tasks.bbclass')
-rw-r--r-- | meta/classes/utility-tasks.bbclass | 69 |
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 0000000000..1792f18e8c --- /dev/null +++ b/meta/classes/utility-tasks.bbclass | |||
@@ -0,0 +1,69 @@ | |||
1 | addtask listtasks | ||
2 | do_listtasks[nostamp] = "1" | ||
3 | python 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 | |||
20 | CLEANFUNCS ?= "" | ||
21 | |||
22 | T_task-clean = "${LOG_DIR}/cleanlogs/${PN}" | ||
23 | addtask clean | ||
24 | do_clean[nostamp] = "1" | ||
25 | python 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 | |||
39 | addtask checkuri | ||
40 | do_checkuri[nostamp] = "1" | ||
41 | python 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 | |||
56 | addtask checkuriall after do_checkuri | ||
57 | do_checkuriall[recrdeptask] = "do_checkuriall do_checkuri" | ||
58 | do_checkuriall[recideptask] = "do_${BB_DEFAULT_TASK}" | ||
59 | do_checkuriall[nostamp] = "1" | ||
60 | do_checkuriall() { | ||
61 | : | ||
62 | } | ||
63 | |||
64 | addtask fetchall after do_fetch | ||
65 | do_fetchall[recrdeptask] = "do_fetchall do_fetch" | ||
66 | do_fetchall[recideptask] = "do_${BB_DEFAULT_TASK}" | ||
67 | do_fetchall() { | ||
68 | : | ||
69 | } | ||