* Re: [PATCH] data_smart.py: Rename variable flags
2013-03-20 17:59 [PATCH] data_smart.py: Rename variable flags Otavio Salvador
@ 2013-03-20 17:58 ` Otavio Salvador
0 siblings, 0 replies; 2+ messages in thread
From: Otavio Salvador @ 2013-03-20 17:58 UTC (permalink / raw)
To: bitbake-devel; +Cc: Otavio Salvador
On Wed, Mar 20, 2013 at 2:59 PM, Otavio Salvador
<otavio@ossystems.com.br> wrote:
> 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 <otavio@ossystems.com.br>
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: otavio@ossystems.com.br http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] data_smart.py: Rename variable flags
@ 2013-03-20 17:59 Otavio Salvador
2013-03-20 17:58 ` Otavio Salvador
0 siblings, 1 reply; 2+ messages in thread
From: Otavio Salvador @ 2013-03-20 17:59 UTC (permalink / raw)
To: bitbake-devel; +Cc: 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 <otavio@ossystems.com.br>
---
bitbake/lib/bb/data_smart.py | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index 5bf11e5..2e43a8e 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -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]:
--
1.8.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-03-20 18:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-20 17:59 [PATCH] data_smart.py: Rename variable flags Otavio Salvador
2013-03-20 17:58 ` Otavio Salvador
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.