summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/parse/parse_py/ConfHandler.py
diff options
context:
space:
mode:
authorHolger Freyther <ich@tamarin.(none)>2009-05-18 19:24:07 +0200
committerRichard Purdie <rpurdie@linux.intel.com>2010-02-15 17:06:50 +0000
commit4b25b519ae46b283988a1847e56a19b01269b3a4 (patch)
tree00392d149975e64e1c685f7621844b2cc00a8792 /bitbake/lib/bb/parse/parse_py/ConfHandler.py
parent5bac3403d7e51f72ee16c8123c2c8607a1d93ca9 (diff)
downloadpoky-4b25b519ae46b283988a1847e56a19b01269b3a4.tar.gz
bitbake: [parser] Cary a Statement Node through the parsing
When parsing we will collect a number of statements that can be evaluated...The plan is to be evaluate things twice (old+new) and then compare the result, it should be the same. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/parse/parse_py/ConfHandler.py')
-rw-r--r--bitbake/lib/bb/parse/parse_py/ConfHandler.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/bitbake/lib/bb/parse/parse_py/ConfHandler.py b/bitbake/lib/bb/parse/parse_py/ConfHandler.py
index 43a3a69bbb..69f2eea1b3 100644
--- a/bitbake/lib/bb/parse/parse_py/ConfHandler.py
+++ b/bitbake/lib/bb/parse/parse_py/ConfHandler.py
@@ -49,7 +49,7 @@ def init(data):
49def supports(fn, d): 49def supports(fn, d):
50 return fn[-5:] == ".conf" 50 return fn[-5:] == ".conf"
51 51
52def include(oldfn, fn, data, error_out): 52def include(statements, oldfn, fn, data, error_out):
53 """ 53 """
54 54
55 error_out If True a ParseError will be reaised if the to be included 55 error_out If True a ParseError will be reaised if the to be included
@@ -70,13 +70,13 @@ def include(oldfn, fn, data, error_out):
70 70
71 from bb.parse import handle 71 from bb.parse import handle
72 try: 72 try:
73 ret = handle(fn, data, True) 73 ret = handle(fn, data, True, statements)
74 except IOError: 74 except IOError:
75 if error_out: 75 if error_out:
76 raise ParseError("Could not %(error_out)s file %(fn)s" % vars() ) 76 raise ParseError("Could not %(error_out)s file %(fn)s" % vars() )
77 bb.msg.debug(2, bb.msg.domain.Parsing, "CONF file '%s' not found" % fn) 77 bb.msg.debug(2, bb.msg.domain.Parsing, "CONF file '%s' not found" % fn)
78 78
79def handle(fn, data, include = 0): 79def handle(fn, data, include, statements):
80 init(data) 80 init(data)
81 81
82 if include == 0: 82 if include == 0:
@@ -103,32 +103,32 @@ def handle(fn, data, include = 0):
103 s2 = f.readline()[:-1].strip() 103 s2 = f.readline()[:-1].strip()
104 lineno = lineno + 1 104 lineno = lineno + 1
105 s = s[:-1] + s2 105 s = s[:-1] + s2
106 feeder(lineno, s, fn, data) 106 feeder(lineno, s, fn, data, statements)
107 107
108 if oldfile: 108 if oldfile:
109 bb.data.setVar('FILE', oldfile, data) 109 bb.data.setVar('FILE', oldfile, data)
110 return data 110 return data
111 111
112def feeder(lineno, s, fn, data): 112def feeder(lineno, s, fn, data, statements):
113 m = __config_regexp__.match(s) 113 m = __config_regexp__.match(s)
114 if m: 114 if m:
115 groupd = m.groupdict() 115 groupd = m.groupdict()
116 ast.handleData(groupd, data) 116 ast.handleData(statements, groupd, data)
117 return 117 return
118 118
119 m = __include_regexp__.match(s) 119 m = __include_regexp__.match(s)
120 if m: 120 if m:
121 ast.handleInclude(m, fn, lineno, data, False) 121 ast.handleInclude(statements, m, fn, lineno, data, False)
122 return 122 return
123 123
124 m = __require_regexp__.match(s) 124 m = __require_regexp__.match(s)
125 if m: 125 if m:
126 ast.handleInclude(m, fn, lineno, data, True) 126 ast.handleInclude(statements, m, fn, lineno, data, True)
127 return 127 return
128 128
129 m = __export_regexp__.match(s) 129 m = __export_regexp__.match(s)
130 if m: 130 if m:
131 ast.handleExport(m, data) 131 ast.handleExport(statements, m, data)
132 return 132 return
133 133
134 raise ParseError("%s:%d: unparsed line: '%s'" % (fn, lineno, s)); 134 raise ParseError("%s:%d: unparsed line: '%s'" % (fn, lineno, s));