summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/parse
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-05-22 10:30:57 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-12 22:50:45 +0100
commit933e19697b680637e5af8131cf5fc833943f68f7 (patch)
tree380e8c3b71b4fdfd233b947ba45317824ebde9d8 /bitbake/lib/bb/parse
parent95be16f428ae4cf4254da0b814a327459a983ef5 (diff)
downloadpoky-933e19697b680637e5af8131cf5fc833943f68f7.tar.gz
bitbake: parse/ast/data_smart: Add parsing flag to getVar/setVar
When parsing we find problems if we clear prepends/appends when setting variables during the initial parsing phases. Later, we actively want to do this (in what would be post finalisation previously). To handle this, pass a parsing flag to the operations to control the correct behaviour for the context. (Bitbake rev: ae87f5b8bf16191b3201cfb445062938eab992a0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/parse')
-rw-r--r--bitbake/lib/bb/parse/ast.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
index 1130b1474c..bd42bd3a7a 100644
--- a/bitbake/lib/bb/parse/ast.py
+++ b/bitbake/lib/bb/parse/ast.py
@@ -85,7 +85,7 @@ class DataNode(AstNode):
85 if 'flag' in self.groupd and self.groupd['flag'] != None: 85 if 'flag' in self.groupd and self.groupd['flag'] != None:
86 return data.getVarFlag(key, self.groupd['flag'], noweakdefault=True) 86 return data.getVarFlag(key, self.groupd['flag'], noweakdefault=True)
87 else: 87 else:
88 return data.getVar(key, False, noweakdefault=True) 88 return data.getVar(key, False, noweakdefault=True, parsing=True)
89 89
90 def eval(self, data): 90 def eval(self, data):
91 groupd = self.groupd 91 groupd = self.groupd
@@ -136,7 +136,7 @@ class DataNode(AstNode):
136 if flag: 136 if flag:
137 data.setVarFlag(key, flag, val, **loginfo) 137 data.setVarFlag(key, flag, val, **loginfo)
138 else: 138 else:
139 data.setVar(key, val, **loginfo) 139 data.setVar(key, val, parsing=True, **loginfo)
140 140
141class MethodNode(AstNode): 141class MethodNode(AstNode):
142 tr_tbl = string.maketrans('/.+-@%&', '_______') 142 tr_tbl = string.maketrans('/.+-@%&', '_______')
@@ -155,10 +155,10 @@ class MethodNode(AstNode):
155 anonfuncs = data.getVar('__BBANONFUNCS', False) or [] 155 anonfuncs = data.getVar('__BBANONFUNCS', False) or []
156 anonfuncs.append(funcname) 156 anonfuncs.append(funcname)
157 data.setVar('__BBANONFUNCS', anonfuncs) 157 data.setVar('__BBANONFUNCS', anonfuncs)
158 data.setVar(funcname, text) 158 data.setVar(funcname, text, parsing=True)
159 else: 159 else:
160 data.setVarFlag(self.func_name, "func", 1) 160 data.setVarFlag(self.func_name, "func", 1)
161 data.setVar(self.func_name, text) 161 data.setVar(self.func_name, text, parsing=True)
162 162
163class PythonMethodNode(AstNode): 163class PythonMethodNode(AstNode):
164 def __init__(self, filename, lineno, function, modulename, body): 164 def __init__(self, filename, lineno, function, modulename, body):
@@ -175,7 +175,7 @@ class PythonMethodNode(AstNode):
175 bb.methodpool.insert_method(self.modulename, text, self.filename) 175 bb.methodpool.insert_method(self.modulename, text, self.filename)
176 data.setVarFlag(self.function, "func", 1) 176 data.setVarFlag(self.function, "func", 1)
177 data.setVarFlag(self.function, "python", 1) 177 data.setVarFlag(self.function, "python", 1)
178 data.setVar(self.function, text) 178 data.setVar(self.function, text, parsing=True)
179 179
180class MethodFlagsNode(AstNode): 180class MethodFlagsNode(AstNode):
181 def __init__(self, filename, lineno, key, m): 181 def __init__(self, filename, lineno, key, m):
@@ -224,11 +224,11 @@ class ExportFuncsNode(AstNode):
224 data.setVarFlag(calledfunc, flag, data.getVarFlag(func, flag)) 224 data.setVarFlag(calledfunc, flag, data.getVarFlag(func, flag))
225 225
226 if data.getVarFlag(calledfunc, "python"): 226 if data.getVarFlag(calledfunc, "python"):
227 data.setVar(func, " bb.build.exec_func('" + calledfunc + "', d)\n") 227 data.setVar(func, " bb.build.exec_func('" + calledfunc + "', d)\n", parsing=True)
228 else: 228 else:
229 if "-" in self.classname: 229 if "-" in self.classname:
230 bb.fatal("The classname %s contains a dash character and is calling an sh function %s using EXPORT_FUNCTIONS. Since a dash is illegal in sh function names, this cannot work, please rename the class or don't use EXPORT_FUNCTIONS." % (self.classname, calledfunc)) 230 bb.fatal("The classname %s contains a dash character and is calling an sh function %s using EXPORT_FUNCTIONS. Since a dash is illegal in sh function names, this cannot work, please rename the class or don't use EXPORT_FUNCTIONS." % (self.classname, calledfunc))
231 data.setVar(func, " " + calledfunc + "\n") 231 data.setVar(func, " " + calledfunc + "\n", parsing=True)
232 data.setVarFlag(func, 'export_func', '1') 232 data.setVarFlag(func, 'export_func', '1')
233 233
234class AddTaskNode(AstNode): 234class AddTaskNode(AstNode):