Add variable-key quality checker
PATCH 1/1 Add variable-key quality checker
Allow to select between a warning or error message when variable key replace the original key.
Signed-off-by Javier Tiá <[email protected]>
--- bitbake/lib/bb/data.py | 11 ++++++++++- meta/classes/insane.bbclass | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-)
bitbake/lib/bb/data.py +10 -1
@@ -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):
meta/classes/insane.bbclass +2 -1
@@ -28,6 +28,7 @@ WARN_QA ?= "ldflags useless-rpaths rpaths staticdev libdir xorg-driver-abi \ pn-overrides infodir build-deps src-uri-bad \ unknown-configure-option symlink-to-sysroot multilib \ invalid-packageconfig host-user-contaminated uppercase-pn patch-fuzz \ + variable-key \ " ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \ perms dep-cmp pkgvarcheck perm-config perm-line perm-link \
@@ -1205,7 +1206,7 @@ do_unpack[postfuncs] += "do_qa_unpack" python () { import re - + tests = d.getVar('ALL_QA').split() if "desktop" in tests: d.appendVar("PACKAGE_DEPENDS", " desktop-file-utils-native")
Signature · 1 line
2.29.2
WARN_QA/ERROR_QA variables don't belong to bitbake, because they are OE specific and bitbake isn't used only by OE.
The same answer from Christopher Larson:
https://lists.openembedded.org/g/bitbake-devel/message/11848
does apply here.
Quoted 63 lines · Javier Tia
Allow to select between a warning or error message when variable key replace the original key.
Signed-off-by Javier Tiá <[email protected]>--- bitbake/lib/bb/data.py | 11 ++++++++++- meta/classes/insane.bbclass | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-)bitbake/lib/bb/data.py +10
-1@@ -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):meta/classes/insane.bbclass +1
-0@@ -28,6 +28,7 @@ WARN_QA ?= "ldflags useless-rpaths rpaths staticdev libdir xorg-driver-abi \ pn-overrides infodir build-deps src-uri-bad \ unknown-configure-option symlink-to-sysroot multilib \ invalid-packageconfig host-user-contaminated uppercase-pn patch-fuzz \ + variable-key \ "ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \ perms dep-cmp pkgvarcheck perm-config perm-line perm-link \meta/classes/insane.bbclass +1
-2@@ -1205,7 +1206,7 @@ do_unpack[postfuncs] += "do_qa_unpack" python () { import re - + tests = d.getVar('ALL_QA').split() if "desktop" in tests: d.appendVar("PACKAGE_DEPENDS", " desktop-file-utils-native") --2.29.2