summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDorinda <dorindabassey@gmail.com>2021-01-26 02:33:59 +0100
committerAnuj Mittal <anuj.mittal@intel.com>2021-02-01 13:43:10 +0800
commit59de426a624edcb02a0f7ad53ee5955d9f3b2cf3 (patch)
treec90b6ea7cde25b2550598695bb9d400cfa1d4ac8
parent35f3e08c52e163e4496c0222896c49888ad5c960 (diff)
downloadopenembedded-core-contrib-59de426a624edcb02a0f7ad53ee5955d9f3b2cf3.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> (cherry picked from commit dbd80a923c9075d363f69ffd86b4392c210d668d) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
-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 0e7ad45c94..16275b2ea5 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -794,6 +794,11 @@ 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 if bitbake is present in PATH environment variable
+ bb_check = bb.utils.which(d.getVar('PATH'), 'bitbake')
+ if not bb_check:
+ bb.warn("bitbake binary is not found in PATH, did you source the script?")
+
# 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')