summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/parse
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-04-13 11:51:17 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-04-13 12:04:18 +0100
commit302f2cc8ce756ab61042f1d904df4d18071a976a (patch)
tree78b753507109222f0c902502573a1137a02cd4ec /bitbake/lib/bb/parse
parent6703173449ad21e1623ac75a66535cb2ed52aeeb (diff)
downloadpoky-302f2cc8ce756ab61042f1d904df4d18071a976a.tar.gz
ConfHandler.py: Add a hook for config parsing
To make the UI settings take effect, we need to hook at the end of each config file parsing and set UI specific values. (Bitbake rev: f54e733c7863110896f43900d9e4e791602f9d65) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/parse')
-rw-r--r--bitbake/lib/bb/parse/parse_py/ConfHandler.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/bitbake/lib/bb/parse/parse_py/ConfHandler.py b/bitbake/lib/bb/parse/parse_py/ConfHandler.py
index fa811f3828..6f77bd4201 100644
--- a/bitbake/lib/bb/parse/parse_py/ConfHandler.py
+++ b/bitbake/lib/bb/parse/parse_py/ConfHandler.py
@@ -71,6 +71,14 @@ def include(oldfn, fn, lineno, data, error_out):
71 raise ParseError("Could not %(error_out)s file %(fn)s" % vars(), oldfn, lineno) 71 raise ParseError("Could not %(error_out)s file %(fn)s" % vars(), oldfn, lineno)
72 logger.debug(2, "CONF file '%s' not found", fn) 72 logger.debug(2, "CONF file '%s' not found", fn)
73 73
74# We have an issue where a UI might want to enforce particular settings such as
75# an empty DISTRO variable. If configuration files do something like assigning
76# a weak default, it turns out to be very difficult to filter out these changes,
77# particularly when the weak default might appear half way though parsing a chain
78# of configuration files. We therefore let the UIs hook into configuration file
79# parsing. This turns out to be a hard problem to solve any other way.
80confFilters = []
81
74def handle(fn, data, include): 82def handle(fn, data, include):
75 init(data) 83 init(data)
76 84
@@ -107,6 +115,9 @@ def handle(fn, data, include):
107 if oldfile: 115 if oldfile:
108 data.setVar('FILE', oldfile) 116 data.setVar('FILE', oldfile)
109 117
118 for f in confFilters:
119 f(fn, data)
120
110 return data 121 return data
111 122
112def feeder(lineno, s, fn, statements): 123def feeder(lineno, s, fn, statements):