aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/cooker.py
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-04-14 14:30:09 -0700
committerChris Larson <chris_larson@mentor.com>2010-04-14 14:58:54 -0700
commit849dbd63244cbc4eaca0f1beedbb67baca024629 (patch)
tree0472c13c9e2191271664c413d870b15bf530fea3 /lib/bb/cooker.py
parent5def1c8c31432968349f9b29d6333d7962260a8b (diff)
downloadbitbake-849dbd63244cbc4eaca0f1beedbb67baca024629.tar.gz
Add a hack to avoid the req that all vars using LAYERDIR be immediately expanded
See the comment in the code for details. Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'lib/bb/cooker.py')
-rw-r--r--lib/bb/cooker.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index eae76f8d0..ee8ac50d1 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -534,11 +534,25 @@ class BBCooker:
layers = (bb.data.getVar('BBLAYERS', data, True) or "").split()
+ data = bb.data.createCopy(data)
for layer in layers:
bb.msg.debug(2, bb.msg.domain.Parsing, "Adding layer %s" % layer)
bb.data.setVar('LAYERDIR', layer, data)
data = bb.parse.handle(os.path.join(layer, "conf", "layer.conf"), data)
+ # XXX: Hack, relies on the local keys of the datasmart
+ # instance being stored in the 'dict' attribute and makes
+ # assumptions about how variable expansion works, but
+ # there's no better way to force an expansion of a single
+ # variable across the datastore today, and this at least
+ # lets us reference LAYERDIR without having to immediately
+ # eval all our variables that use it.
+ for key in data.dict:
+ if key != "_data":
+ value = data.getVar(key, False)
+ if "${LAYERDIR}" in value:
+ data.setVar(key, value.replace("${LAYERDIR}", layer))
+
bb.data.delVar('LAYERDIR', data)
if not data.getVar("BBPATH", True):