All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] data_smart: Drop default expand=False to getVarFlag [API change]
@ 2016-02-02 23:55 Richard Purdie
  2016-02-03  5:36 ` [Openembedded-architecture] " Khem Raj
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Purdie @ 2016-02-02 23:55 UTC (permalink / raw)
  To: bitbake-devel; +Cc: openembedded-architecture

At some point in the future, getVarFlag should expand by default. To
get there from the current position, we need a period of time where the
expand parameter is mandatory.

This patch starts that process. Clear errors will result from any code
which doesn't provide this. Layers can be fixed with an expression
like:

sed -e 's:\(\.getVarFlag([^,()]*, [^,()]*\)):\1, False):g' -i `grep -ril getVar *`

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 79bec1b..d61ad53 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -663,7 +663,7 @@ class DataSmart(MutableMapping):
                 self.dict["__exportlist"]["_content"] = set()
             self.dict["__exportlist"]["_content"].add(var)
 
-    def getVarFlag(self, var, flag, expand=False, noweakdefault=False, parsing=False):
+    def getVarFlag(self, var, flag, expand, noweakdefault=False, parsing=False):
         local_var = self._findVar(var)
         value = None
         if flag == "_content" and var in self.overridedata and not parsing:




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

* Re: [Openembedded-architecture] [PATCH] data_smart: Drop default expand=False to getVarFlag [API change]
  2016-02-02 23:55 [PATCH] data_smart: Drop default expand=False to getVarFlag [API change] Richard Purdie
@ 2016-02-03  5:36 ` Khem Raj
  2016-02-03  8:00   ` Richard Purdie
  0 siblings, 1 reply; 4+ messages in thread
From: Khem Raj @ 2016-02-03  5:36 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-architecture, bitbake-devel

On Tue, Feb 2, 2016 at 3:55 PM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> At some point in the future, getVarFlag should expand by default. To
> get there from the current position, we need a period of time where the
> expand parameter is mandatory.
>

what are advantages of this.

> This patch starts that process. Clear errors will result from any code
> which doesn't provide this. Layers can be fixed with an expression
> like:
>
> sed -e 's:\(\.getVarFlag([^,()]*, [^,()]*\)):\1, False):g' -i `grep -ril getVar *`
>
> 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 79bec1b..d61ad53 100644
> --- a/bitbake/lib/bb/data_smart.py
> +++ b/bitbake/lib/bb/data_smart.py
> @@ -663,7 +663,7 @@ class DataSmart(MutableMapping):
>                  self.dict["__exportlist"]["_content"] = set()
>              self.dict["__exportlist"]["_content"].add(var)
>
> -    def getVarFlag(self, var, flag, expand=False, noweakdefault=False, parsing=False):
> +    def getVarFlag(self, var, flag, expand, noweakdefault=False, parsing=False):
>          local_var = self._findVar(var)
>          value = None
>          if flag == "_content" and var in self.overridedata and not parsing:
>
>
> _______________________________________________
> Openembedded-architecture mailing list
> Openembedded-architecture@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-architecture


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

* Re: [Openembedded-architecture] [PATCH] data_smart: Drop default expand=False to getVarFlag [API change]
  2016-02-03  5:36 ` [Openembedded-architecture] " Khem Raj
@ 2016-02-03  8:00   ` Richard Purdie
  2016-02-03 14:42     ` Khem Raj
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Purdie @ 2016-02-03  8:00 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembedded-architecture, bitbake-devel

On Tue, 2016-02-02 at 21:36 -0800, Khem Raj wrote:
> On Tue, Feb 2, 2016 at 3:55 PM, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> > At some point in the future, getVarFlag should expand by default.
> > To
> > get there from the current position, we need a period of time where
> > the
> > expand parameter is mandatory.
> > 
> 
> what are advantages of this.

Most users expect the data to be expanded by default. Most call sites
also use getVar(xxx, True), its uncommon to see expand=False, outside
the core of bitbake.

So the ultimate advantage is a more sensible default which is what the
user expects and leads to neater/smaller code.

We have had several bugs requesting this and it does confuse people.

I have heard regrets from some of the original developers that the
default wasn't True as well.

Cheers,

Richard



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

* Re: [Openembedded-architecture] [PATCH] data_smart: Drop default expand=False to getVarFlag [API change]
  2016-02-03  8:00   ` Richard Purdie
@ 2016-02-03 14:42     ` Khem Raj
  0 siblings, 0 replies; 4+ messages in thread
From: Khem Raj @ 2016-02-03 14:42 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-architecture, bitbake-devel

On Wed, Feb 3, 2016 at 12:00 AM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> On Tue, 2016-02-02 at 21:36 -0800, Khem Raj wrote:
>> On Tue, Feb 2, 2016 at 3:55 PM, Richard Purdie
>> <richard.purdie@linuxfoundation.org> wrote:
>> > At some point in the future, getVarFlag should expand by default.
>> > To
>> > get there from the current position, we need a period of time where
>> > the
>> > expand parameter is mandatory.
>> >
>>
>> what are advantages of this.
>
> Most users expect the data to be expanded by default. Most call sites
> also use getVar(xxx, True), its uncommon to see expand=False, outside
> the core of bitbake.
>
> So the ultimate advantage is a more sensible default which is what the
> user expects and leads to neater/smaller code.
>

That makes sense.

> We have had several bugs requesting this and it does confuse people.
>
> I have heard regrets from some of the original developers that the
> default wasn't True as well.
>
> Cheers,
>
> Richard
>


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

end of thread, other threads:[~2016-02-03 14:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-02 23:55 [PATCH] data_smart: Drop default expand=False to getVarFlag [API change] Richard Purdie
2016-02-03  5:36 ` [Openembedded-architecture] " Khem Raj
2016-02-03  8:00   ` Richard Purdie
2016-02-03 14:42     ` Khem Raj

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.