bitbake: 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.

(Bitbake rev: ae2b34285f8b3a1a3067c5e9b5d29e32e68c75f1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie 2021-11-04 13:37:30 +00:00
parent fb2300c144
commit e0218edf84

View File

@ -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']