summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorHolger Freyther <ich@tamarin.(none)>2009-05-19 09:37:07 +0200
committerRichard Purdie <rpurdie@linux.intel.com>2010-02-15 17:07:41 +0000
commit118161f46b8219f52779ee5a8dfc632a8964e3c0 (patch)
tree746fe846348b035ea4685ac751edcaa666f87086 /bitbake
parenta20105868f093bf78f00fe6026db80475cfe7cc0 (diff)
downloadpoky-118161f46b8219f52779ee5a8dfc632a8964e3c0.tar.gz
bitbake: [parser] Call eval immeditaley to test this code
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/parse/ast.py37
1 files changed, 4 insertions, 33 deletions
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
index 26bd7236c9..a995b9d3ed 100644
--- a/bitbake/lib/bb/parse/ast.py
+++ b/bitbake/lib/bb/parse/ast.py
@@ -26,12 +26,6 @@ import bb, re, string
26__word__ = re.compile(r"\S+") 26__word__ = re.compile(r"\S+")
27__parsed_methods__ = bb.methodpool.get_parsed_dict() 27__parsed_methods__ = bb.methodpool.get_parsed_dict()
28 28
29def getFunc(groupd, key, data):
30 if 'flag' in groupd and groupd['flag'] != None:
31 return bb.data.getVarFlag(key, groupd['flag'], data)
32 else:
33 return bb.data.getVar(key, data)
34
35class StatementGroup: 29class StatementGroup:
36 def __init__(self): 30 def __init__(self):
37 self.statements = [] 31 self.statements = []
@@ -45,6 +39,9 @@ class StatementGroup:
45 """ 39 """
46 map(lambda x: x.eval(data), self.statements) 40 map(lambda x: x.eval(data), self.statements)
47 41
42 def __getitem__(self, item):
43 return self.statements.__getitem__(item)
44
48class IncludeNode: 45class IncludeNode:
49 def __init__(self, what_file, fn, lineno, force): 46 def __init__(self, what_file, fn, lineno, force):
50 self.what_file = what_file 47 self.what_file = what_file
@@ -140,33 +137,7 @@ def handleExport(statements, m, data):
140def handleData(statements, groupd, data): 137def handleData(statements, groupd, data):
141 # AST handling 138 # AST handling
142 statements.append(DataNode(groupd)) 139 statements.append(DataNode(groupd))
143 140 statements[-1].eval(data)
144 key = groupd["var"]
145 if "exp" in groupd and groupd["exp"] != None:
146 bb.data.setVarFlag(key, "export", 1, data)
147 if "ques" in groupd and groupd["ques"] != None:
148 val = getFunc(groupd, key, data)
149 if val == None:
150 val = groupd["value"]
151 elif "colon" in groupd and groupd["colon"] != None:
152 e = data.createCopy()
153 bb.data.update_data(e)
154 val = bb.data.expand(groupd["value"], e)
155 elif "append" in groupd and groupd["append"] != None:
156 val = "%s %s" % ((getFunc(groupd, key, data) or ""), groupd["value"])
157 elif "prepend" in groupd and groupd["prepend"] != None:
158 val = "%s %s" % (groupd["value"], (getFunc(groupd, key, data) or ""))
159 elif "postdot" in groupd and groupd["postdot"] != None:
160 val = "%s%s" % ((getFunc(groupd, key, data) or ""), groupd["value"])
161 elif "predot" in groupd and groupd["predot"] != None:
162 val = "%s%s" % (groupd["value"], (getFunc(groupd, key, data) or ""))
163 else:
164 val = groupd["value"]
165 if 'flag' in groupd and groupd['flag'] != None:
166 bb.msg.debug(3, bb.msg.domain.Parsing, "setVarFlag(%s, %s, %s, data)" % (key, groupd['flag'], val))
167 bb.data.setVarFlag(key, groupd['flag'], val, data)
168 else:
169 bb.data.setVar(key, val, data)
170 141
171def handleMethod(statements, func_name, lineno, fn, body, d): 142def handleMethod(statements, func_name, lineno, fn, body, d):
172 if func_name == "__anonymous": 143 if func_name == "__anonymous":