summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/parse/parse_py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/parse/parse_py')
-rw-r--r--bitbake/lib/bb/parse/parse_py/BBHandler.py4
-rw-r--r--bitbake/lib/bb/parse/parse_py/ConfHandler.py14
2 files changed, 13 insertions, 5 deletions
diff --git a/bitbake/lib/bb/parse/parse_py/BBHandler.py b/bitbake/lib/bb/parse/parse_py/BBHandler.py
index 584966fea1..4d5b45e1ef 100644
--- a/bitbake/lib/bb/parse/parse_py/BBHandler.py
+++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py
@@ -101,7 +101,7 @@ def get_statements(filename, absolute_filename, base_name):
101 cached_statements[absolute_filename] = statements 101 cached_statements[absolute_filename] = statements
102 return statements 102 return statements
103 103
104def handle(fn, d, include): 104def handle(fn, d, include, baseconfig=False):
105 global __infunc__, __body__, __residue__, __classname__ 105 global __infunc__, __body__, __residue__, __classname__
106 __body__ = [] 106 __body__ = []
107 __infunc__ = [] 107 __infunc__ = []
@@ -265,7 +265,7 @@ def feeder(lineno, s, fn, root, statements, eof=False):
265 ast.handleInherit(statements, fn, lineno, m) 265 ast.handleInherit(statements, fn, lineno, m)
266 return 266 return
267 267
268 return ConfHandler.feeder(lineno, s, fn, statements) 268 return ConfHandler.feeder(lineno, s, fn, statements, conffile=False)
269 269
270# Add us to the handlers list 270# Add us to the handlers list
271from .. import handlers 271from .. import handlers
diff --git a/bitbake/lib/bb/parse/parse_py/ConfHandler.py b/bitbake/lib/bb/parse/parse_py/ConfHandler.py
index 451e68dd66..3076067287 100644
--- a/bitbake/lib/bb/parse/parse_py/ConfHandler.py
+++ b/bitbake/lib/bb/parse/parse_py/ConfHandler.py
@@ -46,6 +46,7 @@ __require_regexp__ = re.compile( r"require\s+(.+)" )
46__export_regexp__ = re.compile( r"export\s+([a-zA-Z0-9\-_+.${}/~]+)$" ) 46__export_regexp__ = re.compile( r"export\s+([a-zA-Z0-9\-_+.${}/~]+)$" )
47__unset_regexp__ = re.compile( r"unset\s+([a-zA-Z0-9\-_+.${}/~]+)$" ) 47__unset_regexp__ = re.compile( r"unset\s+([a-zA-Z0-9\-_+.${}/~]+)$" )
48__unset_flag_regexp__ = re.compile( r"unset\s+([a-zA-Z0-9\-_+.${}/~]+)\[([a-zA-Z0-9\-_+.]+)\]$" ) 48__unset_flag_regexp__ = re.compile( r"unset\s+([a-zA-Z0-9\-_+.${}/~]+)\[([a-zA-Z0-9\-_+.]+)\]$" )
49__addpylib_regexp__ = re.compile(r"addpylib\s+(.+)\s+(.+)" )
49 50
50def init(data): 51def init(data):
51 return 52 return
@@ -107,7 +108,7 @@ def include_single_file(parentfn, fn, lineno, data, error_out):
107# parsing. This turns out to be a hard problem to solve any other way. 108# parsing. This turns out to be a hard problem to solve any other way.
108confFilters = [] 109confFilters = []
109 110
110def handle(fn, data, include): 111def handle(fn, data, include, baseconfig=False):
111 init(data) 112 init(data)
112 113
113 if include == 0: 114 if include == 0:
@@ -144,7 +145,7 @@ def handle(fn, data, include):
144 # skip comments 145 # skip comments
145 if s[0] == '#': 146 if s[0] == '#':
146 continue 147 continue
147 feeder(lineno, s, abs_fn, statements) 148 feeder(lineno, s, abs_fn, statements, baseconfig=baseconfig)
148 149
149 # DONE WITH PARSING... time to evaluate 150 # DONE WITH PARSING... time to evaluate
150 data.setVar('FILE', abs_fn) 151 data.setVar('FILE', abs_fn)
@@ -157,7 +158,9 @@ def handle(fn, data, include):
157 158
158 return data 159 return data
159 160
160def feeder(lineno, s, fn, statements): 161# baseconfig is set for the bblayers/layer.conf cookerdata config parsing
162# The function is also used by BBHandler, conffile would be False
163def feeder(lineno, s, fn, statements, baseconfig=False, conffile=True):
161 m = __config_regexp__.match(s) 164 m = __config_regexp__.match(s)
162 if m: 165 if m:
163 groupd = m.groupdict() 166 groupd = m.groupdict()
@@ -189,6 +192,11 @@ def feeder(lineno, s, fn, statements):
189 ast.handleUnsetFlag(statements, fn, lineno, m) 192 ast.handleUnsetFlag(statements, fn, lineno, m)
190 return 193 return
191 194
195 m = __addpylib_regexp__.match(s)
196 if baseconfig and conffile and m:
197 ast.handlePyLib(statements, fn, lineno, m)
198 return
199
192 raise ParseError("unparsed line: '%s'" % s, fn, lineno); 200 raise ParseError("unparsed line: '%s'" % s, fn, lineno);
193 201
194# Add us to the handlers list 202# Add us to the handlers list