[bitbake-devel,04/16] data_smart: Improve variable expansion regexp

Submitted by Richard Purdie on Sept. 16, 2013, 9:53 p.m.

Details

Message ID 1379368413-9808-4-git-send-email-richard.purdie@linuxfoundation.org
State Accepted
Commit c630d564285f55f9db10c18269bd310df797430e
Headers show

Commit Message

Richard Purdie Sept. 16, 2013, 9:53 p.m.
Debugging showed the variable expansion regexp was catching python
expressions (starting with @). Since these are caught by their own
dedicated regexp, stop matching these for the plain variable expansion
for small performance improvements.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 lib/bb/data_smart.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index 635b259..9be5d5e 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -40,7 +40,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"\${[^{}]+}")
+__expand_var_regexp__ = re.compile(r"\${[^{}@]+}")
 __expand_python_regexp__ = re.compile(r"\${@.+?}")
 
 def infer_caller_details(loginfo, parent = False, varval = True):