summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/data.py
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2007-08-16 09:55:21 +0000
committerRichard Purdie <richard@openedhand.com>2007-08-16 09:55:21 +0000
commit7611768e23d9809f458691454c2aeb60d7b26e7d (patch)
tree050786d6475e1d0ed219d01dac1f02b1ebbdbb81 /bitbake/lib/bb/data.py
parent11ce59b501b5c82f6705db4d76e468fcbe3412db (diff)
downloadpoky-7611768e23d9809f458691454c2aeb60d7b26e7d.tar.gz
bitbake: Sync with 1.8 head. Adds locking to the fetcher to prevent parallel downloads, fixes key expansion issues and occasional missing dependency graph links
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2502 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'bitbake/lib/bb/data.py')
-rw-r--r--bitbake/lib/bb/data.py33
1 files changed, 15 insertions, 18 deletions
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py
index b2025f0694..21cdde04a8 100644
--- a/bitbake/lib/bb/data.py
+++ b/bitbake/lib/bb/data.py
@@ -96,6 +96,19 @@ def getVar(var, d, exp = 0):
96 """ 96 """
97 return d.getVar(var,exp) 97 return d.getVar(var,exp)
98 98
99
100def renameVar(key, newkey, d):
101 """Renames a variable from key to newkey
102
103 Example:
104 >>> d = init()
105 >>> setVar('TEST', 'testcontents', d)
106 >>> renameVar('TEST', 'TEST2', d)
107 >>> print getVar('TEST2', d)
108 testcontents
109 """
110 d.renameVar(key, newkey)
111
99def delVar(var, d): 112def delVar(var, d):
100 """Removes a variable from the data set 113 """Removes a variable from the data set
101 114
@@ -276,24 +289,8 @@ def expandKeys(alterdata, readdata = None):
276 ekey = expand(key, readdata) 289 ekey = expand(key, readdata)
277 if key == ekey: 290 if key == ekey:
278 continue 291 continue
279 val = getVar(key, alterdata) 292
280 if val is None: 293 renameVar(key, ekey, alterdata)
281 continue
282# import copy
283# setVarFlags(ekey, copy.copy(getVarFlags(key, readdata)), alterdata)
284 setVar(ekey, val, alterdata)
285
286 for i in ('_append', '_prepend'):
287 dest = getVarFlag(ekey, i, alterdata) or []
288 src = getVarFlag(key, i, readdata) or []
289 dest.extend(src)
290 setVarFlag(ekey, i, dest, alterdata)
291
292 if key in alterdata._special_values[i]:
293 alterdata._special_values[i].remove(key)
294 alterdata._special_values[i].add(ekey)
295
296 delVar(key, alterdata)
297 294
298def expandData(alterdata, readdata = None): 295def expandData(alterdata, readdata = None):
299 """For each variable in alterdata, expand it, and update the var contents. 296 """For each variable in alterdata, expand it, and update the var contents.