[bitbake-devel] [PATCH 2/2] data_smart: handle '\x7d' in python parsing

Markus Lehtonen markus.lehtonen at linux.intel.com
Wed Feb 3 10:33:39 UTC 2016


At least ncurses recipe uses a workaround (for former bitbake python
parser) where closing curly bracket inside a python string was replaced
by '\x7d' ascii code. The previous "curly bracket matching" patch broke
parsing of constructs like this as bitbake wouldn't correctly find the
closing bracket. This patch fixes this by accepting '\x7d' as a closing
bracket.

Hopefully, this patch could be reverted (and the python regexp thus
simplified) in the future after making sure that no recipes use the
'\x7d' workaround, anymore.

[YOCTO #8849]

Signed-off-by: Markus Lehtonen <markus.lehtonen at linux.intel.com>
---
 lib/bb/data_smart.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index 6069499..5f48fe3 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -41,7 +41,7 @@ logger = logging.getLogger("BitBake.Data")
 __setvar_keyword__ = ["_append", "_prepend", "_remove"]
 __setvar_regexp__ = re.compile('(?P<base>.*?)(?P<keyword>_append|_prepend|_remove)(_(?P<add>.*))?$')
 __expand_var_regexp__ = re.compile(r"\${[^{}@\n\t ]+}")
-__expand_python_regexp__ = re.compile(r"\${@(({[^{]*?})|.)+?}")
+__expand_python_regexp__ = re.compile(r"\${@(({[^{]*?(}|\\x7d))|.)+?}")
 
 def infer_caller_details(loginfo, parent = False, varval = True):
     """Save the caller the trouble of specifying everything."""
-- 
2.1.4




More information about the bitbake-devel mailing list