summaryrefslogtreecommitdiffstats
path: root/lib/bb/data_smart.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-06-11 23:11:05 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-12 22:50:27 +0100
commit40d661aaf7a563c6447b073310c5f2fdae6ca3d0 (patch)
tree77d87cb11f2d7e89f76948d1afabef6ab652fc15 /lib/bb/data_smart.py
parenta97ce216cfe44136f742383542954bfce027831e (diff)
downloadopenembedded-core-contrib-40d661aaf7a563c6447b073310c5f2fdae6ca3d0.tar.gz
data_smart: Fix appendVar/prependVar
Now that overrides get expanded 'on the fly', change appendVar and prependVar to work using _append and _prepend, else we'd have to re-implement pieces of getVar and the timing of expansions becomes problematic. Using _append/_prepend equivalence gives the behaviour users likley expect from these functions. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/data_smart.py')
-rw-r--r--lib/bb/data_smart.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index b7ccab767e..7755f1afd8 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -540,14 +540,12 @@ class DataSmart(MutableMapping):
def appendVar(self, var, value, **loginfo):
loginfo['op'] = 'append'
self.varhistory.record(**loginfo)
- newvalue = (self.getVar(var, False) or "") + value
- self.setVar(var, newvalue, ignore=True)
+ self.setVar(var + "_append", value, ignore=True, parsing=True)
def prependVar(self, var, value, **loginfo):
loginfo['op'] = 'prepend'
self.varhistory.record(**loginfo)
- newvalue = value + (self.getVar(var, False) or "")
- self.setVar(var, newvalue, ignore=True)
+ self.setVar(var + "_prepend", value, ignore=True, parsing=True)
def delVar(self, var, **loginfo):
loginfo['detail'] = ""