Instead of iterating every datastore value by hand to find tasks, use
the new bb.build.listtasks() function (bitbake 185c4b)

Signed-off-by: Ross Burton <[email protected]>
---
 meta/classes-global/utility-tasks.bbclass | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/meta/classes-global/utility-tasks.bbclass 
b/meta/classes-global/utility-tasks.bbclass
index ae2da330b86..394cc3158d5 100644
--- a/meta/classes-global/utility-tasks.bbclass
+++ b/meta/classes-global/utility-tasks.bbclass
@@ -9,18 +9,17 @@ do_listtasks[nostamp] = "1"
 python do_listtasks() {
     taskdescs = {}
     maxlen = 0
-    for e in d.keys():
-        if d.getVarFlag(e, 'task'):
-            maxlen = max(maxlen, len(e))
-            if e.endswith('_setscene'):
-                desc = "%s (setscene version)" % (d.getVarFlag(e[:-9], 'doc') 
or '')
-            else:
-                desc = d.getVarFlag(e, 'doc') or ''
-            taskdescs[e] = desc
-
-    tasks = sorted(taskdescs.keys())
-    for taskname in tasks:
-        bb.plain("%s  %s" % (taskname.ljust(maxlen), taskdescs[taskname]))
+    for t in bb.build.listtasks(d):
+        maxlen = max(maxlen, len(t))
+
+        if t.endswith('_setscene'):
+            desc = "%s (setscene version)" % (d.getVarFlag(t[:-9], 'doc') or 
'')
+        else:
+            desc = d.getVarFlag(t, 'doc') or ''
+        taskdescs[t] = desc
+
+    for task, doc in sorted(taskdescs.items()):
+        bb.plain("%s  %s" % (task.ljust(maxlen), doc))
 }
 
 CLEANFUNCS ?= ""
-- 
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#208277): 
https://lists.openembedded.org/g/openembedded-core/message/208277
Mute This Topic: https://lists.openembedded.org/mt/109917971/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to