From 7611768e23d9809f458691454c2aeb60d7b26e7d Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 16 Aug 2007 09:55:21 +0000 Subject: 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 --- bitbake/lib/bb/data.py | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) (limited to 'bitbake/lib/bb/data.py') 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): """ return d.getVar(var,exp) + +def renameVar(key, newkey, d): + """Renames a variable from key to newkey + + Example: + >>> d = init() + >>> setVar('TEST', 'testcontents', d) + >>> renameVar('TEST', 'TEST2', d) + >>> print getVar('TEST2', d) + testcontents + """ + d.renameVar(key, newkey) + def delVar(var, d): """Removes a variable from the data set @@ -276,24 +289,8 @@ def expandKeys(alterdata, readdata = None): ekey = expand(key, readdata) if key == ekey: continue - val = getVar(key, alterdata) - if val is None: - continue -# import copy -# setVarFlags(ekey, copy.copy(getVarFlags(key, readdata)), alterdata) - setVar(ekey, val, alterdata) - - for i in ('_append', '_prepend'): - dest = getVarFlag(ekey, i, alterdata) or [] - src = getVarFlag(key, i, readdata) or [] - dest.extend(src) - setVarFlag(ekey, i, dest, alterdata) - - if key in alterdata._special_values[i]: - alterdata._special_values[i].remove(key) - alterdata._special_values[i].add(ekey) - - delVar(key, alterdata) + + renameVar(key, ekey, alterdata) def expandData(alterdata, readdata = None): """For each variable in alterdata, expand it, and update the var contents. -- cgit 1.2.3-korg