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-04 13:42:24 +0000 |
commit | ae2b34285f8b3a1a3067c5e9b5d29e32e68c75f1 (patch) | |
tree | 8db6497464b87fd18bc628a9d7e5e97d7328e63f | |
parent | 78949cf3fd31d8a408e93af7e27bcf26ae7942f4 (diff) | |
download | bitbake-ae2b34285f8b3a1a3067c5e9b5d29e32e68c75f1.tar.gz |
parse/ast: Show errors 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.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | lib/bb/parse/ast.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/bb/parse/ast.py b/lib/bb/parse/ast.py index 743ea0dfc..93cbf285e 100644 --- a/lib/bb/parse/ast.py +++ b/lib/bb/parse/ast.py @@ -130,6 +130,10 @@ class DataNode(AstNode): else: val = groupd["value"] + if ":append" in key or ":remove" in key or ":prepend" in key: + if op in ["append", "prepend", "postdot", "predot"]: + bb.warn(key + " " + groupd[op] + " is not a recommended operator combination, please replace it.") + flag = None if 'flag' in groupd and groupd['flag'] is not None: flag = groupd['flag'] |