]> code.ossystems Code Review - openembedded-core.git/commitdiff
sanity.bbclass: Detect and fail if 'inherit' is used in conf file
authorGregor Zatko <gzatko@gmail.com>
Sun, 24 May 2020 10:24:04 +0000 (12:24 +0200)
committerSteve Sakoman <steve@sakoman.com>
Tue, 26 May 2020 16:47:59 +0000 (06:47 -1000)
'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

[YOCTO #5426]

Signed-off-by: Gregor Zatko <gzatko@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 07bf9b460fe97dec86439302a83bbefa8bac9d70)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
meta/classes/sanity.bbclass

index 9e871017389680fdd0f0f63c6ead478100aa4683..5ddde9cc9cab43826573f1a46295d9c90bc0d01d 100644 (file)
@@ -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')