data_smart: Restrict expansion regexp to not include : characters
PATCH 1/1 data_smart: Restrict expansion regexp to not include : characters
Bitbake variables don't include ":" characters so exclude these from the variable expansion regexp.
This assists when parsing shell code which does A=${B:-C} as we don't want a dependency on a variable called "B:-C".
Signed-off-by Richard Purdie <[email protected]>
bitbake/lib/bb/data_smart.py +1 -1
@@ -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"\${[^{}@\n\t ]+}") +__expand_var_regexp__ = re.compile(r"\${[^{}@\n\t :]+}") __expand_python_regexp__ = re.compile(r"\${@.+?}") def infer_caller_details(loginfo, parent = False, varval = True):
Quoted 10 lines · Richard Purdie
Bitbake variables don't include ":" characters so exclude these from the variable
expansion regexp.This assists when parsing shell code which does A=${B:-C} as we don't want a
dependency on a variable called "B:-C".Signed-off-by Richard Purdie <[email protected]>
Nice, this one's been bugging me on and off for a while :) Looks good.