sanity.bbclass: Detect and fail if 'inherit' is used in conf file
PATCH 1/1 sanity.bbclass: Detect and fail if 'inherit' is used in conf file
'inherit' directive may not be used in conf files as it's supposed to be used for the inheritance of classes.
Correct form in conf file is INHERIT.
This commit adds:
- a sanity check to find whether the wrong case exists
- fail the build if so
- tell user about the difference in directives
https://bugzilla.yoctoproject.org/show_bug.cgi?id=5426
--- meta/classes/sanity.bbclass | 6 ++++++ 1 file changed, 6 insertions(+)
meta/classes/sanity.bbclass +6 -0
@@ -784,6 +784,12 @@ def check_sanity_everybuild(status, d): if "." in paths or "./" in paths or "" in paths: status.addresult("PATH contains '.', './' or '' (empty element), which will break the build, please remove this.\nParsed PATH is " + str(paths) + "\n") + # Check whether 'inherit' directive is found (used for a class to inherit) + # in conf file it's supposed to be uppercase INHERIT + inherit = d.getVar('inherit') + if inherit: + status.addresult("Please don't use inherit directive in your local.conf. The directive is supposed to be used in classes and recipes only to inherit of bbclasses. Here INHERIT should be used.\n") + # Check that the DISTRO is valid, if set # need to take into account DISTRO renaming DISTRO distro = d.getVar('DISTRO')
Signature · 1 line
2.26.2
Quoted 35 lines · Gregor Zatko
'inherit' directive may not be used in conf files as it's supposed to be used for the inheritance of classes.
Correct form in conf file is INHERIT.This commit adds:
- a sanity check to find whether the wrong case exists
- fail the build if so
- tell user about the difference in directiveshttps://bugzilla.yoctoproject.org/show_bug.cgi?id=5426
Signed-off-by Gregor Zatko <[email protected]>--- meta/classes/sanity.bbclass | 6 ++++++ 1 file changed, 6 insertions(+)meta/classes/sanity.bbclass +6
-1@@ -784,6 +784,12 @@ def check_sanity_everybuild(status, d): if "." in paths or "./" in paths or "" in paths: status.addresult("PATH contains '.', './' or '' (empty element), which will break the build, please remove this.\nParsed PATH is " + str(paths) + "\n") + # Check whether 'inherit' directive is found (used for a class to inherit) + # in conf file it's supposed to be uppercase INHERIT + inherit = d.getVar('inherit') + if inherit: + status.addresult("Please don't use inherit directive in your local.conf. The directive is supposed to be used in classes and recipes only to inherit of bbclasses. Here INHERIT should be used.\n") + # Check that the DISTRO is valid, if set # need to take into account DISTRO renaming DISTRO distro = d.getVar('DISTRO') --
Quoted 1 line
2.26.2
From https://www.openembedded.org/wiki/How_to_submit_a_patch_to_OpenEmbedded:
Please substitute "PATCH" with "PATCH v2" if you are submitting a revised version after addressing feedback (or v3, v4 etc.).
I've seen several versions of this patch today and it would be easy to lose track of which one is the latest if they arrive in someone's inbox out-of-order.
No need to re-send just for this but please add a version next time.
Thanks,
Signature · 2 lines
Paul Barker Konsulko Group
Ok, thanks for the info.I shall read the guidelines again as I started to contribute in the beginning of the year but was 3 months off then. I'll add that next time.
Quoted 39 lines · Paul Barker
Quoted 12 lines · Gregor Zatko
'inherit' directive may not be used in conf files as it's supposedto be used for the inheritance of classes.Correct form in conf file is INHERIT.
This commit adds:- a sanity check to find whether the wrong case exists- fail the build if so- tell user about the difference in directives
https://bugzilla.yoctoproject.org/show_bug.cgi?id=5426Signed-off-by Gregor Zatko <[email protected]>---meta/classes/sanity.bbclass | 6 ++++++ 1 file changed, 6 insertions(+)
(quoted diff) +0
-0Quoted 16 lines
b/meta/classes/sanity.bbclassindex
292c5591dd..e021b9d240100644--- a/meta/classes/sanity.bbclass+++ b/meta/classes/sanity.bbclass@@
-784,6 +784,12 @@ defcheck_sanity_everybuild(status, d): if
"." in paths or "./" in paths or "" in
paths: status.addresult("PATH contains '.', './' or ''
(empty element), which will break the build, please remove this.\nParsed PATH is " + str(paths) + "\n")
+ # Check whether 'inherit' directive is found (used for a class
to inherit)+ # in conf file it's supposed to be uppercase
INHERIT+ inherit = d.getVar('inherit')+ if
inherit:+ status.addresult("Please don't use inherit
directive in your local.conf. The directive is supposed to be used in classes and recipes only to inherit of bbclasses. Here INHERIT
should be used.\n")+ # Check that the DISTRO is valid, if
set # need to take into account DISTRO renaming
DISTRO distro = d.getVar('DISTRO')--2.26.2From
https://www.openembedded.org/wiki/How_to_submit_a_patch_to_OpenEmbedded:Please
substitute "PATCH" with "PATCH v2" if you are submitting arevised version after addressing feedback (or v3, v4 etc.).
I've seen several versions of this patch today and it would be easy tolose track of which one is the latest if they arrive in someone'sinbox out-of-order.
No need to re-send just for this but please add a version next time. Thanks,