summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/data_smart.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/data_smart.py')
-rw-r--r--bitbake/lib/bb/data_smart.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index ef1e9dda07..e879343f5d 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -170,6 +170,28 @@ class DataSmart:
170 return self.expand(value,var) 170 return self.expand(value,var)
171 return value 171 return value
172 172
173 def renameVar(self, key, newkey):
174 """
175 Rename the variable key to newkey
176 """
177 val = self.getVar(key, 0)
178 if val is None:
179 return
180
181 self.setVar(newkey, val)
182
183 for i in ('_append', '_prepend'):
184 dest = self.getVarFlag(newkey, i) or []
185 src = self.getVarFlag(key, i) or []
186 dest.extend(src)
187 self.setVarFlag(newkey, i, dest)
188
189 if self._special_values.has_key(i) and key in self._special_values[i]:
190 self._special_values[i].remove(key)
191 self._special_values[i].add(newkey)
192
193 self.delVar(key)
194
173 def delVar(self,var): 195 def delVar(self,var):
174 self.expand_cache = {} 196 self.expand_cache = {}
175 self.dict[var] = {} 197 self.dict[var] = {}