diff options
| author | Peter Kjellerstedt <peter.kjellerstedt@axis.com> | 2025-09-16 23:19:34 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-10-07 13:53:06 +0100 |
| commit | b5bd55359fbae8704f26908a2b4744b88c8720cd (patch) | |
| tree | 35bf7627825a7076ed82899508337be49527a21c | |
| parent | ea8ed90b8d62e8f08aa383edde56f42693708bb5 (diff) | |
| download | poky-b5bd55359fbae8704f26908a2b4744b88c8720cd.tar.gz | |
bitbake: parse: Make include_all raise a parse error for absolute paths
It makes no sense to use an absolute path with include_all.
(Bitbake rev: a39d1d5df740824d40c4d8e7f4199ccc518592e0)
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | bitbake/lib/bb/parse/parse_py/ConfHandler.py | 3 | ||||
| -rw-r--r-- | bitbake/lib/bb/tests/parse.py | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/bitbake/lib/bb/parse/parse_py/ConfHandler.py b/bitbake/lib/bb/parse/parse_py/ConfHandler.py index af3af2ccee..d876f6c1ff 100644 --- a/bitbake/lib/bb/parse/parse_py/ConfHandler.py +++ b/bitbake/lib/bb/parse/parse_py/ConfHandler.py | |||
| @@ -68,6 +68,9 @@ def include(parentfn, fns, lineno, data, error_out, all=False): | |||
| 68 | # "include" or "require" accept zero to n space-separated file names to include. | 68 | # "include" or "require" accept zero to n space-separated file names to include. |
| 69 | for fn in fns.split(): | 69 | for fn in fns.split(): |
| 70 | if all: | 70 | if all: |
| 71 | if os.path.isabs(fn): | ||
| 72 | raise ParseError("Incorrect use of include_all with an absolute path %s" % fn, parentfn, lineno) | ||
| 73 | |||
| 71 | for path in data.getVar("BBPATH").split(":"): | 74 | for path in data.getVar("BBPATH").split(":"): |
| 72 | include_single_file(parentfn, os.path.join(path, fn), lineno, data, error_out) | 75 | include_single_file(parentfn, os.path.join(path, fn), lineno, data, error_out) |
| 73 | else: | 76 | else: |
diff --git a/bitbake/lib/bb/tests/parse.py b/bitbake/lib/bb/tests/parse.py index 2f77c90f60..d6bc5a38bf 100644 --- a/bitbake/lib/bb/tests/parse.py +++ b/bitbake/lib/bb/tests/parse.py | |||
| @@ -500,6 +500,7 @@ EXTRA_OECONF:append = " foobar" | |||
| 500 | test_helper("include_all someother.conf", None) | 500 | test_helper("include_all someother.conf", None) |
| 501 | test_helper("include_all some3.conf", " foobar") | 501 | test_helper("include_all some3.conf", " foobar") |
| 502 | test_helper("include_all ${@''}", None) | 502 | test_helper("include_all ${@''}", None) |
| 503 | test_helper("include_all " + tempdir + "/conf2/some.conf", bb.parse.ParseError) | ||
| 503 | 504 | ||
| 504 | self.d.setVar("BBPATH", tempdir + "/conf2" + ":" + tempdir + "/conf1") | 505 | self.d.setVar("BBPATH", tempdir + "/conf2" + ":" + tempdir + "/conf1") |
| 505 | 506 | ||
