data_smart: Drop default expand=False to getVarFlag [API change]
PATCH 1/1 data_smart: Drop default expand=False to getVarFlag [API change]
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 *
bitbake/lib/bb/data_smart.py +1 -1
@@ -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:
Quoted 4 lines · Richard Purdie
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.
Quoted 26 lines
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 <[email protected]>bitbake/lib/bb/data_smart.py +1
-1@@ -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
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-architecture
Quoted 10 lines · Khem Raj
Quoted 6 lines · Richard Purdie
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
Quoted 10 lines · Richard Purdie
Quoted 9 lines · Khem Raj
Quoted 6 lines · Richard Purdie
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.
Quoted 9 lines
Quoted 1 line
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.
Quoted 9 lines
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