diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-08-10 14:35:29 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-08-12 15:27:17 +0100 |
commit | fd1517e2b51a170f2427122c6b95396db251d827 (patch) | |
tree | dabfe3e631339c2fc99a9ee7febb0f9c128e325e /meta/classes-global/utility-tasks.bbclass | |
parent | 10317912ee319ccf7f83605d438b5cbf9663f296 (diff) | |
download | poky-fd1517e2b51a170f2427122c6b95396db251d827.tar.gz |
classes: Update classes to match new bitbake class scope functionality
Move classes to classes-global or classes-recipe as appropriate to take
advantage of new bitbake functionality to check class scope/usage.
(From OE-Core rev: f5c128008365e141082c129417eb72d2751e8045)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-global/utility-tasks.bbclass')
-rw-r--r-- | meta/classes-global/utility-tasks.bbclass | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/meta/classes-global/utility-tasks.bbclass b/meta/classes-global/utility-tasks.bbclass new file mode 100644 index 0000000000..ae2da330b8 --- /dev/null +++ b/meta/classes-global/utility-tasks.bbclass | |||
@@ -0,0 +1,60 @@ | |||
1 | # | ||
2 | # Copyright OpenEmbedded Contributors | ||
3 | # | ||
4 | # SPDX-License-Identifier: MIT | ||
5 | # | ||
6 | |||
7 | addtask listtasks | ||
8 | do_listtasks[nostamp] = "1" | ||
9 | python do_listtasks() { | ||
10 | taskdescs = {} | ||
11 | maxlen = 0 | ||
12 | for e in d.keys(): | ||
13 | if d.getVarFlag(e, 'task'): | ||
14 | maxlen = max(maxlen, len(e)) | ||
15 | if e.endswith('_setscene'): | ||
16 | desc = "%s (setscene version)" % (d.getVarFlag(e[:-9], 'doc') or '') | ||
17 | else: | ||
18 | desc = d.getVarFlag(e, 'doc') or '' | ||
19 | taskdescs[e] = desc | ||
20 | |||
21 | tasks = sorted(taskdescs.keys()) | ||
22 | for taskname in tasks: | ||
23 | bb.plain("%s %s" % (taskname.ljust(maxlen), taskdescs[taskname])) | ||
24 | } | ||
25 | |||
26 | CLEANFUNCS ?= "" | ||
27 | |||
28 | T:task-clean = "${LOG_DIR}/cleanlogs/${PN}" | ||
29 | addtask clean | ||
30 | do_clean[nostamp] = "1" | ||
31 | python do_clean() { | ||
32 | """clear the build and temp directories""" | ||
33 | dir = d.expand("${WORKDIR}") | ||
34 | bb.note("Removing " + dir) | ||
35 | oe.path.remove(dir) | ||
36 | |||
37 | dir = "%s.*" % d.getVar('STAMP') | ||
38 | bb.note("Removing " + dir) | ||
39 | oe.path.remove(dir) | ||
40 | |||
41 | for f in (d.getVar('CLEANFUNCS') or '').split(): | ||
42 | bb.build.exec_func(f, d) | ||
43 | } | ||
44 | |||
45 | addtask checkuri | ||
46 | do_checkuri[nostamp] = "1" | ||
47 | do_checkuri[network] = "1" | ||
48 | python do_checkuri() { | ||
49 | src_uri = (d.getVar('SRC_URI') or "").split() | ||
50 | if len(src_uri) == 0: | ||
51 | return | ||
52 | |||
53 | try: | ||
54 | fetcher = bb.fetch2.Fetch(src_uri, d) | ||
55 | fetcher.checkstatus() | ||
56 | except bb.fetch2.BBFetchException as e: | ||
57 | bb.fatal(str(e)) | ||
58 | } | ||
59 | |||
60 | |||