]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
classes/utility-tasks: port do_listtasks to use bb.build.listtasks
authorRoss Burton <ross.burton@arm.com>
Wed, 11 Dec 2024 12:08:46 +0000 (12:08 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 12 Dec 2024 13:31:20 +0000 (13:31 +0000)
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 <ross.burton@arm.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
meta/classes-global/utility-tasks.bbclass

index ae2da330b86922e722636ab65634b68feae1dc15..394cc3158d5dc91037577b6ab78096899f1a5cc1 100644 (file)
@@ -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 ?= ""