summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/parse/parse_py/ConfHandler.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/parse/parse_py/ConfHandler.py')
-rw-r--r--bitbake/lib/bb/parse/parse_py/ConfHandler.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/bitbake/lib/bb/parse/parse_py/ConfHandler.py b/bitbake/lib/bb/parse/parse_py/ConfHandler.py
index 6ae9d973e7..9242632c50 100644
--- a/bitbake/lib/bb/parse/parse_py/ConfHandler.py
+++ b/bitbake/lib/bb/parse/parse_py/ConfHandler.py
@@ -44,10 +44,11 @@ def init(data):
44def supports(fn, d): 44def supports(fn, d):
45 return fn[-5:] == ".conf" 45 return fn[-5:] == ".conf"
46 46
47def include(oldfn, fn, data, error_out): 47def include(oldfn, fn, lineno, data, error_out):
48 """ 48 """
49 error_out If True a ParseError will be raised if the to be included 49 error_out: A string indicating the verb (e.g. "include", "inherit") to be
50 config-files could not be included. 50 used in a ParseError that will be raised if the file to be included could
51 not be included. Specify False to avoid raising an error in this case.
51 """ 52 """
52 if oldfn == fn: # prevent infinite recursion 53 if oldfn == fn: # prevent infinite recursion
53 return None 54 return None
@@ -68,7 +69,7 @@ def include(oldfn, fn, data, error_out):
68 ret = handle(fn, data, True) 69 ret = handle(fn, data, True)
69 except IOError: 70 except IOError:
70 if error_out: 71 if error_out:
71 raise ParseError("Could not %(error_out)s file %(fn)s" % vars() ) 72 raise ParseError("Could not %(error_out)s file %(fn)s" % vars(), oldfn, lineno)
72 logger.debug(2, "CONF file '%s' not found", fn) 73 logger.debug(2, "CONF file '%s' not found", fn)
73 74
74def handle(fn, data, include): 75def handle(fn, data, include):
@@ -131,7 +132,7 @@ def feeder(lineno, s, fn, statements):
131 ast.handleExport(statements, fn, lineno, m) 132 ast.handleExport(statements, fn, lineno, m)
132 return 133 return
133 134
134 raise ParseError("%s:%d: unparsed line: '%s'" % (fn, lineno, s)); 135 raise ParseError("unparsed line: '%s'" % s, fn, lineno);
135 136
136# Add us to the handlers list 137# Add us to the handlers list
137from bb.parse import handlers 138from bb.parse import handlers