summaryrefslogtreecommitdiffstats
path: root/meta/classes/sanity.bbclass
diff options
context:
space:
mode:
authorDorinda <dorindabassey@gmail.com>2021-01-26 02:33:59 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-01-27 10:17:45 +0000
commitdbd80a923c9075d363f69ffd86b4392c210d668d (patch)
treebbcfc6065b30b34d6a2db9e302a18b1c9735bf57 /meta/classes/sanity.bbclass
parentbfeeaf9ff148a61868e0c882b7455dc02ca8ed76 (diff)
downloadpoky-dbd80a923c9075d363f69ffd86b4392c210d668d.tar.gz
sanity.bbclass: sanity check for if bitbake is present in PATH
If a user executes the environment script instead of sourcing it, there's an error about an empty element in PATH. This is because bitbake isn't present in environment variable PATH. Hence, this patch adds a sanity check to verify if bitbake is present in PATH and if bitbake isn't present issue a warning message. [YOCTO #13822] (From OE-Core rev: e08799913a7f207bc63e085eb98196fd61ed57bc) Signed-off-by: Dorinda Bassey <dorindabassey@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/sanity.bbclass')
-rw-r--r--meta/classes/sanity.bbclass5
1 files changed, 5 insertions, 0 deletions
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 62b5253911..c6842ff549 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -794,6 +794,11 @@ def check_sanity_everybuild(status, d):
794 if "." in paths or "./" in paths or "" in paths: 794 if "." in paths or "./" in paths or "" in paths:
795 status.addresult("PATH contains '.', './' or '' (empty element), which will break the build, please remove this.\nParsed PATH is " + str(paths) + "\n") 795 status.addresult("PATH contains '.', './' or '' (empty element), which will break the build, please remove this.\nParsed PATH is " + str(paths) + "\n")
796 796
797 #Check if bitbake is present in PATH environment variable
798 bb_check = bb.utils.which(d.getVar('PATH'), 'bitbake')
799 if not bb_check:
800 bb.warn("bitbake binary is not found in PATH, did you source the script?")
801
797 # Check whether 'inherit' directive is found (used for a class to inherit) 802 # Check whether 'inherit' directive is found (used for a class to inherit)
798 # in conf file it's supposed to be uppercase INHERIT 803 # in conf file it's supposed to be uppercase INHERIT
799 inherit = d.getVar('inherit') 804 inherit = d.getVar('inherit')