From: Jan Kiszka <jan.kiszka@siemens.com>
To: Alexander Smirnov <asmirnov@ilbers.de>, isar-users@googlegroups.com
Cc: Claudius Heine <ch@denx.de>
Subject: Re: [PATCH v2] meta/classes/base: Fix showdata and liststasks after bitbake update
Date: Mon, 12 Feb 2018 08:44:27 +0100 [thread overview]
Message-ID: <cfd90316-d2df-89a6-54bb-fa9c142863fa@siemens.com> (raw)
In-Reply-To: <20180209172850.28852-1-asmirnov@ilbers.de>
On 2018-02-09 18:28, Alexander Smirnov wrote:
> From: Claudius Heine <ch@denx.de>
>
> 8<--
>
> Just added references to origin code in comment. Didn't touch the code.
>
> 8<--
>
> Those tasks were broken, this patchs fixes by implementing them similar
> to how openembedded-core does it.
>
> Signed-off-by: Claudius Heine <ch@denx.de>
> ---
> meta/classes/base.bbclass | 30 +++++++++++++++++++-----------
> 1 file changed, 19 insertions(+), 11 deletions(-)
>
> diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
> index 7d44f72..ae84677 100644
> --- a/meta/classes/base.bbclass
> +++ b/meta/classes/base.bbclass
> @@ -37,25 +37,33 @@ bbfatal() {
> exit 1
> }
>
> +# Derived from bitbake: bitbake/classes/base.bbclass
> 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)))
> + for e in d.keys():
> + if d.getVarFlag(e, 'python'):
> + bb.plain("\npython %s () {\n%s}\n" % (e, d.getVar(e, True)))
> }
>
> +# Derived from Open Embedded: openembedded-core/meta/classes/utility-tasks.bbclass
> addtask listtasks
> do_listtasks[nostamp] = "1"
> python do_listtasks() {
> - import sys
> - for e in bb.data.keys(d):
> - if bb.data.getVarFlag(e, 'task', d):
> - sys.__stdout__.write("%s\n" % e)
> + 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]))
> }
>
> do_fetch[dirs] = "${DL_DIR}"
>
Looks good to me, and it also fixes the broken indention of those tasks,
something bitbake started to complain here after enabling signatures.
Please merge to next.
Jan
next prev parent reply other threads:[~2018-02-12 7:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-09 17:28 Alexander Smirnov
2018-02-09 18:16 ` Henning Schild
2018-02-09 18:42 ` Alexander Smirnov
2018-02-09 19:33 ` Henning Schild
2018-02-09 20:18 ` Alexander Smirnov
2018-02-12 7:44 ` Jan Kiszka [this message]
2018-02-12 9:14 ` Alexander Smirnov
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=cfd90316-d2df-89a6-54bb-fa9c142863fa@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=asmirnov@ilbers.de \
--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