summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2020-10-09 14:58:14 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-10-10 13:37:44 +0100
commit8a4c473c07cba159cf88ed775b9f073c6adf31d4 (patch)
treee47772110e3626e4b57252888725bc230320ebae
parentc77651549dd382007c60767076a1a1c72e282bca (diff)
downloadopenembedded-core-contrib-8a4c473c07cba159cf88ed775b9f073c6adf31d4.tar.gz
base.bbclass: warn when there is trailing slash in S or B variables
* to make sure we won't hit such corner cases in future add a warning to prevent trailing slashes and duplicated slashes even when they in most cases don't cause harm * only a few cases were found in layers included in my world builds: oe-core: 1 meta-oe: 7 meta-python2: 1 meta-qt5: 1 meta-aws: 1 will send patches for these once this warning is approved for oe-core Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/base.bbclass5
1 files changed, 5 insertions, 0 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 62e34d0079..5a0b0c6b3e 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -388,6 +388,11 @@ python () {
oe.utils.features_backfill("DISTRO_FEATURES", d)
oe.utils.features_backfill("MACHINE_FEATURES", d)
+ if d.getVar("S")[-1] == '/':
+ bb.warn("Recipe %s sets S variable with trailing slash '%s', remove it" % (d.getVar("PN"), d.getVar("S")))
+ if d.getVar("B")[-1] == '/':
+ bb.warn("Recipe %s sets B variable with trailing slash '%s', remove it" % (d.getVar("PN"), d.getVar("B")))
+
if os.path.normpath(d.getVar("WORKDIR")) != os.path.normpath(d.getVar("S")):
d.appendVar("PSEUDO_IGNORE_PATHS", ",${S}")
if os.path.normpath(d.getVar("WORKDIR")) != os.path.normpath(d.getVar("B")):