Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 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 | |