From 8a4c473c07cba159cf88ed775b9f073c6adf31d4 Mon Sep 17 00:00:00 2001 From: Martin Jansa Date: Fri, 9 Oct 2020 14:58:14 +0200 Subject: 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 Signed-off-by: Richard Purdie --- meta/classes/base.bbclass | 5 +++++ 1 file changed, 5 insertions(+) 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")): -- cgit 1.2.3-korg