diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-11-04 13:37:30 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-11-10 19:25:38 +0000 |
commit | 02f36dc832ae786dd0f790d86820611a71f0b960 (patch) | |
tree | e6e241630f62c8aa6249f961721ae11b19df4580 /bitbake/lib/bb/parse | |
parent | d922f577ae6174ebba20b131850d81a9d62fa29a (diff) | |
download | poky-02f36dc832ae786dd0f790d86820611a71f0b960.tar.gz |
bitbake: parse/ast: Show warnings for append/prepend/remove operators combined with +=/.=
Operations like XXX:append += "YYY" are almost always wrong and this
is a common mistake made in the metadata. Show warnings for these usages
with a view to making it a fatal error eventually.
(Bitbake rev: 8c31e75557dc6a8d8f407b5d24d6327889a3e3b1)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/parse')
-rw-r--r-- | bitbake/lib/bb/parse/ast.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py index 743ea0dfc0..31bcc8e7ac 100644 --- a/bitbake/lib/bb/parse/ast.py +++ b/bitbake/lib/bb/parse/ast.py | |||
@@ -130,6 +130,10 @@ class DataNode(AstNode): | |||
130 | else: | 130 | else: |
131 | val = groupd["value"] | 131 | val = groupd["value"] |
132 | 132 | ||
133 | if ":append" in key or ":remove" in key or ":prepend" in key: | ||
134 | if op in ["append", "prepend", "postdot", "predot", "ques"]: | ||
135 | bb.warn(key + " " + groupd[op] + " is not a recommended operator combination, please replace it.") | ||
136 | |||
133 | flag = None | 137 | flag = None |
134 | if 'flag' in groupd and groupd['flag'] is not None: | 138 | if 'flag' in groupd and groupd['flag'] is not None: |
135 | flag = groupd['flag'] | 139 | flag = groupd['flag'] |