diff options
author | Martin Jansa <Martin.Jansa@gmail.com> | 2020-10-09 14:58:14 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-10-10 13:37:56 +0100 |
commit | f5b4cd065f414de353b30f9b43254973d18b6acb (patch) | |
tree | c40643080e72ff59e09737fd04d1826de19df22d /meta/classes | |
parent | 0576fb4b6f8aaf26a80385d38bf42cb74ee97460 (diff) | |
download | poky-f5b4cd065f414de353b30f9b43254973d18b6acb.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
(From OE-Core rev: 8a4c473c07cba159cf88ed775b9f073c6adf31d4)
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/base.bbclass | 5 |
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 () { | |||
388 | oe.utils.features_backfill("DISTRO_FEATURES", d) | 388 | oe.utils.features_backfill("DISTRO_FEATURES", d) |
389 | oe.utils.features_backfill("MACHINE_FEATURES", d) | 389 | oe.utils.features_backfill("MACHINE_FEATURES", d) |
390 | 390 | ||
391 | if d.getVar("S")[-1] == '/': | ||
392 | bb.warn("Recipe %s sets S variable with trailing slash '%s', remove it" % (d.getVar("PN"), d.getVar("S"))) | ||
393 | if d.getVar("B")[-1] == '/': | ||
394 | bb.warn("Recipe %s sets B variable with trailing slash '%s', remove it" % (d.getVar("PN"), d.getVar("B"))) | ||
395 | |||
391 | if os.path.normpath(d.getVar("WORKDIR")) != os.path.normpath(d.getVar("S")): | 396 | if os.path.normpath(d.getVar("WORKDIR")) != os.path.normpath(d.getVar("S")): |
392 | d.appendVar("PSEUDO_IGNORE_PATHS", ",${S}") | 397 | d.appendVar("PSEUDO_IGNORE_PATHS", ",${S}") |
393 | if os.path.normpath(d.getVar("WORKDIR")) != os.path.normpath(d.getVar("B")): | 398 | if os.path.normpath(d.getVar("WORKDIR")) != os.path.normpath(d.getVar("B")): |