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