From 42a59961fa34b098e86c8a358375f2af43779833 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 23 Jan 2015 17:33:51 +0000 Subject: bitbake: data_smart: Defer append/prepend handling (Bitbake rev: b1ce9975ef96f2506042832f4518cde73f6be917) Signed-off-by: Richard Purdie --- bitbake/lib/bb/data_smart.py | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'bitbake/lib/bb/data_smart.py') diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py index 7bb7b4aae3..b433489a84 100644 --- a/bitbake/lib/bb/data_smart.py +++ b/bitbake/lib/bb/data_smart.py @@ -429,12 +429,13 @@ class DataSmart(MutableMapping): continue if op == "_append": - sval = self.getVar(append, False) or "" - sval += a - self.setVar(append, sval) + apps = self.getVarFlag(append, "_appendactive", False) or [] + apps.extend([a]) + self.setVarFlag(append, "_appendactive", apps, ignore=True) elif op == "_prepend": - sval = a + (self.getVar(append, False) or "") - self.setVar(append, sval) + prepends = self.getVarFlag(append, "_prependactive", False) or [] + prepends.extend([a]) + self.setVarFlag(append, "_prependactive", prepends, ignore=True) elif op == "_remove": removes = self.getVarFlag(append, "_removeactive", False) or [] removes.extend(a.split()) @@ -507,6 +508,11 @@ class DataSmart(MutableMapping): if not var in self.dict: self._makeShadowCopy(var) + if "_appendactive" in self.dict[var]: + del self.dict[var]["_appendactive"] + if "_prependactive" in self.dict[var]: + del self.dict[var]["_prependactive"] + # more cookies for the cookie monster if '_' in var: self._setvar_update_overrides(var) @@ -612,6 +618,17 @@ class DataSmart(MutableMapping): value = copy.copy(local_var[flag]) elif flag == "_content" and "_defaultval" in local_var and not noweakdefault: value = copy.copy(local_var["_defaultval"]) + + if flag == "_content" and local_var is not None and "_appendactive" in local_var: + if not value: + value = "" + for r in local_var["_appendactive"]: + value = value + r + if flag == "_content" and local_var is not None and "_prependactive" in local_var: + if not value: + value = "" + for r in local_var["_prependactive"]: + value = r + value if expand and value: # Only getvar (flag == _content) hits the expand cache cachename = None -- cgit v1.2.3-54-g00ecf