summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/data_smart.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-01-23 17:33:51 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-12 22:50:44 +0100
commit42a59961fa34b098e86c8a358375f2af43779833 (patch)
tree8ab93da6e8bcd1ac4d52796fe9dad57a8c4e1b27 /bitbake/lib/bb/data_smart.py
parent5ae52eec3a14322ef0f4b4d3759bac3eaa62f0fc (diff)
downloadpoky-42a59961fa34b098e86c8a358375f2af43779833.tar.gz
bitbake: data_smart: Defer append/prepend handling
(Bitbake rev: b1ce9975ef96f2506042832f4518cde73f6be917) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/data_smart.py')
-rw-r--r--bitbake/lib/bb/data_smart.py27
1 files changed, 22 insertions, 5 deletions
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):
429 continue 429 continue
430 430
431 if op == "_append": 431 if op == "_append":
432 sval = self.getVar(append, False) or "" 432 apps = self.getVarFlag(append, "_appendactive", False) or []
433 sval += a 433 apps.extend([a])
434 self.setVar(append, sval) 434 self.setVarFlag(append, "_appendactive", apps, ignore=True)
435 elif op == "_prepend": 435 elif op == "_prepend":
436 sval = a + (self.getVar(append, False) or "") 436 prepends = self.getVarFlag(append, "_prependactive", False) or []
437 self.setVar(append, sval) 437 prepends.extend([a])
438 self.setVarFlag(append, "_prependactive", prepends, ignore=True)
438 elif op == "_remove": 439 elif op == "_remove":
439 removes = self.getVarFlag(append, "_removeactive", False) or [] 440 removes = self.getVarFlag(append, "_removeactive", False) or []
440 removes.extend(a.split()) 441 removes.extend(a.split())
@@ -507,6 +508,11 @@ class DataSmart(MutableMapping):
507 if not var in self.dict: 508 if not var in self.dict:
508 self._makeShadowCopy(var) 509 self._makeShadowCopy(var)
509 510
511 if "_appendactive" in self.dict[var]:
512 del self.dict[var]["_appendactive"]
513 if "_prependactive" in self.dict[var]:
514 del self.dict[var]["_prependactive"]
515
510 # more cookies for the cookie monster 516 # more cookies for the cookie monster
511 if '_' in var: 517 if '_' in var:
512 self._setvar_update_overrides(var) 518 self._setvar_update_overrides(var)
@@ -612,6 +618,17 @@ class DataSmart(MutableMapping):
612 value = copy.copy(local_var[flag]) 618 value = copy.copy(local_var[flag])
613 elif flag == "_content" and "_defaultval" in local_var and not noweakdefault: 619 elif flag == "_content" and "_defaultval" in local_var and not noweakdefault:
614 value = copy.copy(local_var["_defaultval"]) 620 value = copy.copy(local_var["_defaultval"])
621
622 if flag == "_content" and local_var is not None and "_appendactive" in local_var:
623 if not value:
624 value = ""
625 for r in local_var["_appendactive"]:
626 value = value + r
627 if flag == "_content" and local_var is not None and "_prependactive" in local_var:
628 if not value:
629 value = ""
630 for r in local_var["_prependactive"]:
631 value = r + value
615 if expand and value: 632 if expand and value:
616 # Only getvar (flag == _content) hits the expand cache 633 # Only getvar (flag == _content) hits the expand cache
617 cachename = None 634 cachename = None