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.bbclass62
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 @@
1addtask listtasks
2do_listtasks[nostamp] = "1"
3python 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
13CLEANFUNCS ?= ""
14
15T_task-clean = "${LOG_DIR}/cleanlogs/${PN}"
16addtask clean
17do_clean[nostamp] = "1"
18python 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
32addtask checkuri
33do_checkuri[nostamp] = "1"
34python 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
49addtask checkuriall after do_checkuri
50do_checkuriall[recrdeptask] = "do_checkuriall do_checkuri"
51do_checkuriall[recideptask] = "do_${BB_DEFAULT_TASK}"
52do_checkuriall[nostamp] = "1"
53do_checkuriall() {
54 :
55}
56
57addtask fetchall after do_fetch
58do_fetchall[recrdeptask] = "do_fetchall do_fetch"
59do_fetchall[recideptask] = "do_${BB_DEFAULT_TASK}"
60do_fetchall() {
61 :
62}