All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] data_smart: Restrict expansion regexp to not include : characters
@ 2016-04-08 22:47 Richard Purdie
  2016-04-10 18:37 ` Christopher Larson
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Purdie @ 2016-04-08 22:47 UTC (permalink / raw)
  To: bitbake-devel

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 <richard.purdie@linuxfoundation.org>

diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index d61ad53..fa1e794 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/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"\${[^{}@\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):




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] data_smart: Restrict expansion regexp to not include : characters
  2016-04-08 22:47 [PATCH] data_smart: Restrict expansion regexp to not include : characters Richard Purdie
@ 2016-04-10 18:37 ` Christopher Larson
  0 siblings, 0 replies; 2+ messages in thread
From: Christopher Larson @ 2016-04-10 18:37 UTC (permalink / raw)
  To: Richard Purdie, bitbake-devel

[-- Attachment #1: Type: text/plain, Size: 483 bytes --]

On Fri, Apr 8, 2016 at 3:48 PM Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:

> 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 <richard.purdie@linuxfoundation.org>
>

Nice, this one's been bugging me on and off for a while :) Looks good.

[-- Attachment #2: Type: text/html, Size: 870 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-10 18:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-08 22:47 [PATCH] data_smart: Restrict expansion regexp to not include : characters Richard Purdie
2016-04-10 18:37 ` Christopher Larson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.