data_smart.py: Rename variable flags
PATCH 1/1 data_smart.py: Rename variable flags
The variable expansion needs to handle variable flags as well otherwise those do not behave as expected. One example of this is:
,----
| ALTERNATIVE_TARGET_${PN}-foo[name] = "value"
`----
Signed-off-by Otavio Salvador <[email protected]>
--- bitbake/lib/bb/data_smart.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
lib/bb/data_smart.py +7 -3
@@ -515,13 +515,17 @@ class DataSmart(MutableMapping): self.varhistory.record(**loginfo) self.setVar(newkey, val, ignore=True) - for i in ('_append', '_prepend'): + for i in (self.getVarFlags(key) or {}).keys(): src = self.getVarFlag(key, i) if src is None: continue - dest = self.getVarFlag(newkey, i) or [] - dest.extend(src) + if i in ('_append', '_prepend'): + dest = self.getVarFlag(newkey, i) or [] + else: + dest = self.getVarFlag(newkey, i) or '' + dest += src + self.setVarFlag(newkey, i, dest, ignore=True) if i in self._special_values and key in self._special_values[i]:
Signature · 1 line
1.8.1
Quoted 8 lines · Otavio Salvador
The variable expansion needs to handle variable flags as well otherwise those do not behave as expected. One example of this is:
,----
| ALTERNATIVE_TARGET_${PN}-foo[name] = "value"
`----Signed-off-by Otavio Salvador <[email protected]>
I think this does not work for all cases but I don't know how to deal properly with it. It fixes the case of updates-alternative but breaks other code.
--
Otavio Salvador O.S. Systems
E-mail: [email protected] http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br