]> code.ossystems Code Review - openembedded-core.git/commitdiff
layer.conf: fix sanity error for PATH variable in extensible SDK workflow
authorSourabh Banerjee <sbanerje@codeaurora.org>
Tue, 13 Oct 2020 16:45:10 +0000 (22:15 +0530)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 17 Oct 2020 11:33:30 +0000 (12:33 +0100)
Sanity checker reports following error for the PATH variable,
when bitbake -e <recipe> command is run in an extensible SDK workspace.
   PATH contains '.', './' or '' (empty element), which will break the build

In case of extensible SDK, PATH variable is formed with two consecutive ':'
as bb.utils.which(d.getVar('PATH'),'bitbake') call returns an empty string.

This change adds ':' if BITBAKEPATH is a non empty string.

Signed-off-by: Sourabh Banerjee <sbanerje@codeaurora.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/conf/layer.conf

index d5934927a6849a492d3d426e0ac8a8cb134a421a..2d9cd056958a574b53dce88e2521f370c8730f29 100644 (file)
@@ -102,4 +102,6 @@ SSTATE_EXCLUDEDEPS_SYSROOT += "\
 SSTATE_EXCLUDEDEPS_SYSROOT += ".*->autoconf-archive-native"
 
 # We need to keep bitbake tools in PATH
-PATH := "${@os.path.dirname(bb.utils.which(d.getVar('PATH'),'bitbake'))}:${HOSTTOOLS_DIR}"
+# Avoid empty path entries
+BITBAKEPATH := "${@os.path.dirname(bb.utils.which(d.getVar('PATH'),'bitbake'))}"
+PATH := "${@'${BITBAKEPATH}:' if '${BITBAKEPATH}' is not '' else ''}${HOSTTOOLS_DIR}"