From: claudius.heine.ext@siemens.com
To: isar-users@googlegroups.com
Cc: Claudius Heine <ch@denx.de>
Subject: [PATCH] meta/classes/base: fixed listtasks by copying code from oe-core
Date: Thu, 8 Feb 2018 10:57:03 +0100 [thread overview]
Message-ID: <20180208095703.2441-1-claudius.heine.ext@siemens.com> (raw)
From: Claudius Heine <ch@denx.de>
The listtasks task seemed to be broken, here I fixed it by just copying
the code from openembedded-core.
Signed-off-by: Claudius Heine <ch@denx.de>
---
meta/classes/base.bbclass | 27 +++++++++++++++++----------
1 file changed, 17 insertions(+), 10 deletions(-)
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 7d44f72..ede2c3e 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -37,16 +37,23 @@ bbfatal() {
exit 1
}
-addtask showdata
-do_showdata[nostamp] = "1"
-python do_showdata() {
- import sys
- # emit variables and shell functions
- bb.data.emit_env(sys.__stdout__, d, True)
- # emit the metadata which isnt valid shell
- for e in bb.data.keys(d):
- if bb.data.getVarFlag(e, 'python', d):
- sys.__stdout__.write("\npython %s () {\n%s}\n" % (e, bb.data.getVar(e, d, 1)))
+addtask listtasks
+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]))
}
addtask listtasks
--
2.15.1
next reply other threads:[~2018-02-08 9:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-08 9:57 claudius.heine.ext [this message]
2018-02-08 9:58 ` Claudius Heine
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180208095703.2441-1-claudius.heine.ext@siemens.com \
--to=claudius.heine.ext@siemens.com \
--cc=ch@denx.de \
--cc=isar-users@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox