>> 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.*" % d.getVar('STAMP')
32 bb.note("Removing " + dir)
33 oe.path.remove(dir)
34
35 for f in (d.getVar('CLEANFUNCS') 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') or "").split()
43 if len(src_uri) == 0:
44 ¦ return
45
46 try:
47 ¦ fetcher = bb.fetch2.Fetch(src_uri, d)
48 ¦ fetcher.checkstatus()
49 except bb.fetch2.BBFetchException as e:
50 ¦ bb.fatal(str(e))
51 }
base.bbclass 详细分析 —— utility-tasks.bbclass
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- 1 设置 NATIVELSBSTRING ORIGNATIVELSBSTRING BB_VERSION 2 hos...
- Handle backfilling Handle PACKAGECONFIG 用到的方法 根据PACKAGECO...
- 定义了 do_patch的行为 —— 可以使用quilt git工具进行patch。这块知道即可。