All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add variable-key quality checker
@ 2020-11-24 20:36 Javier Tia
  2020-11-24 21:00 ` [bitbake-devel] " Christopher Larson
  0 siblings, 1 reply; 3+ messages in thread
From: Javier Tia @ 2020-11-24 20:36 UTC (permalink / raw)
  To: bitbake-devel; +Cc: Javier Tiá

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>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-24 23:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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.