]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: data_smart: Fix unanchored regexp causing strange parsing issue
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 3 Aug 2012 09:24:32 +0000 (10:24 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 3 Aug 2012 09:25:10 +0000 (10:25 +0100)
If this regular expression is unanchored, it would accept strings like:

do_install_append1
do_install_appendsomelongstring

and treat them like they were do_install_append. Clearly this isn't desirable.
Only one instance of this type of issue was found in OE-Core and has been fixed
so correcting the regexp should be safe to do.

(Bitbake rev: 23bd5300b4a99218a15f4f6b0ab4091d63a602a5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/data_smart.py

index 730deaaaf2e69c82c377f89e0c47a04a62eb243f..31216e04ab50be7f3bae88c04172df5a7fe8ab31 100644 (file)
@@ -39,7 +39,7 @@ from bb.COW  import COWDictBase
 logger = logging.getLogger("BitBake.Data")
 
 __setvar_keyword__ = ["_append", "_prepend"]
-__setvar_regexp__ = re.compile('(?P<base>.*?)(?P<keyword>_append|_prepend)(_(?P<add>.*))?')
+__setvar_regexp__ = re.compile('(?P<base>.*?)(?P<keyword>_append|_prepend)(_(?P<add>.*))?$')
 __expand_var_regexp__ = re.compile(r"\${[^{}]+}")
 __expand_python_regexp__ = re.compile(r"\${@.+?}")