All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Javier Tia" <javier.tia@hpe.com>
To: Christopher Larson <kergoth@gmail.com>
Cc: "bitbake-devel@lists.openembedded.org"
	<bitbake-devel@lists.openembedded.org>
Subject: Re: [bitbake-devel] [PATCH] Add variable-key quality checker
Date: Tue, 24 Nov 2020 23:42:22 +0000	[thread overview]
Message-ID: <30468da2-d01a-7de1-adfe-3ac0588029e0@hpe.com> (raw)
In-Reply-To: <CABcZANmna7TCPY2yZKkzgUqTw6ofyKg_cOTJZ1uTBTik+1M0zg@mail.gmail.com>


Sorry I don't follow. Should I submit the patch to the 
openembedded-core@lists.openembedded.org mailing list?



I have a new modification that works as it's expected:


     msg = "Variable key %s (%s) replaces original key %s (%s)." % (key, 
val, ekey, newval)
     error_qa = alterdata.expand(alterdata.getVar('ERROR_QA', False))
     warn_qa = alterdata.expand(alterdata.getVar('WARN_QA', False))
     if error_qa is not None and 'variable-key' in error_qa:
         bb.error(msg)
     elif warn_qa is not None and 'variable-key' in warn_qa:
         bb.warn(msg)
     else:
         bb.warn(msg)


Thanks for considering the patch,
▷ Javier's 🖊

On 11/24/20 3:00 PM, Christopher Larson wrote:
> ERROR_QA and WARN_QA are OE variables, not bitbake ones, and they are 
> space separated lists of words, so would need to be split to be used.
> 
> On Tue, Nov 24, 2020 at 1:36 PM Javier Tia <javier.tia@hpe.com 
> <mailto:javier.tia@hpe.com>> wrote:
> 
>     Allow to select between a warning or error message when variable key
>     replace the original key.
> 
>     Signed-off-by: Javier Tiá <javier.tia@hpe.com
>     <mailto:javier.tia@hpe.com>>
>     ---
>       lib/bb/data.py | 11 ++++++++++-
>       1 file changed, 10 insertions(+), 1 deletion(-)
> 
>     diff --git a/lib/bb/data.py b/lib/bb/data.py
>     index 0d75d0c1..ca14d64a 100644
>     --- a/lib/bb/data.py
>     +++ b/lib/bb/data.py
>     @@ -100,7 +100,16 @@ def expandKeys(alterdata, readdata = None):
>               if newval is not None:
>                   val = alterdata.getVar(key, False)
>                   if val is not None:
>     -                bb.warn("Variable key %s (%s) replaces original key
>     %s (%s)." % (key, val, ekey, newval))
>     +                msg = "Variable key %s (%s) replaces original key
>     %s (%s)." % (key, val, ekey, newval)
>     +                error_qa = alterdata.getVar('ERROR_QA', False)
>     +                warn_qa = alterdata.getVar('WARN_QA', False)
>     +                if error_qa and 'variable-key' in error_qa:
>     +                    bb.error(msg)
>     +                elif warn_qa and 'variable-key' in warn_qa:
>     +                    bb.warn(msg)
>     +                else:
>     +                    bb.warn(msg)
>     +
>               alterdata.renameVar(key, ekey)
> 
>       def inheritFromOS(d, savedenv, permitted):
>     -- 
>     2.29.2
> 
> 
> -- 
> Christopher Larson
> kergoth at gmail dot com
> Founder - BitBake, OpenEmbedded, OpenZaurus
> Senior Software Engineer, Mentor Graphics

      reply	other threads:[~2020-11-24 23:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-24 20:36 [PATCH] Add variable-key quality checker Javier Tia
2020-11-24 21:00 ` [bitbake-devel] " Christopher Larson
2020-11-24 23:42   ` Javier Tia [this message]

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=30468da2-d01a-7de1-adfe-3ac0588029e0@hpe.com \
    --to=javier.tia@hpe.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=kergoth@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.