mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 12:29:55 +00:00
bitbake: data_smart: Defer append/prepend handling
(Bitbake rev: b1ce9975ef96f2506042832f4518cde73f6be917) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -429,12 +429,13 @@ class DataSmart(MutableMapping):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
if op == "_append":
|
if op == "_append":
|
||||||
sval = self.getVar(append, False) or ""
|
apps = self.getVarFlag(append, "_appendactive", False) or []
|
||||||
sval += a
|
apps.extend([a])
|
||||||
self.setVar(append, sval)
|
self.setVarFlag(append, "_appendactive", apps, ignore=True)
|
||||||
elif op == "_prepend":
|
elif op == "_prepend":
|
||||||
sval = a + (self.getVar(append, False) or "")
|
prepends = self.getVarFlag(append, "_prependactive", False) or []
|
||||||
self.setVar(append, sval)
|
prepends.extend([a])
|
||||||
|
self.setVarFlag(append, "_prependactive", prepends, ignore=True)
|
||||||
elif op == "_remove":
|
elif op == "_remove":
|
||||||
removes = self.getVarFlag(append, "_removeactive", False) or []
|
removes = self.getVarFlag(append, "_removeactive", False) or []
|
||||||
removes.extend(a.split())
|
removes.extend(a.split())
|
||||||
@@ -507,6 +508,11 @@ class DataSmart(MutableMapping):
|
|||||||
if not var in self.dict:
|
if not var in self.dict:
|
||||||
self._makeShadowCopy(var)
|
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
|
# more cookies for the cookie monster
|
||||||
if '_' in var:
|
if '_' in var:
|
||||||
self._setvar_update_overrides(var)
|
self._setvar_update_overrides(var)
|
||||||
@@ -612,6 +618,17 @@ class DataSmart(MutableMapping):
|
|||||||
value = copy.copy(local_var[flag])
|
value = copy.copy(local_var[flag])
|
||||||
elif flag == "_content" and "_defaultval" in local_var and not noweakdefault:
|
elif flag == "_content" and "_defaultval" in local_var and not noweakdefault:
|
||||||
value = copy.copy(local_var["_defaultval"])
|
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:
|
if expand and value:
|
||||||
# Only getvar (flag == _content) hits the expand cache
|
# Only getvar (flag == _content) hits the expand cache
|
||||||
cachename = None
|
cachename = None
|
||||||
|
|||||||
Reference in New Issue
Block a user