summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/parse/parse_py/BBHandler.py
diff options
context:
space:
mode:
authorHolger Freyther <ich@tamarin.(none)>2009-05-19 13:59:50 +0200
committerRichard Purdie <rpurdie@linux.intel.com>2010-02-15 17:07:55 +0000
commit7b57ad901af2ded02995d22718ec6f280a9edd7f (patch)
tree81b9b3909460269bdd60744a255ac923775fa71c /bitbake/lib/bb/parse/parse_py/BBHandler.py
parent83ec5eaed411225d16a4fc4dc92323e3acc9f5cd (diff)
downloadpoky-7b57ad901af2ded02995d22718ec6f280a9edd7f.tar.gz
bitbake: [parser] Make resolve_file only resolve the path
Do not attempt to open the file in the resolve_file method (a lot like bb.which... maybe bb.which can be used). This way we don't need to open/close a file which we have already parsed. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/parse/parse_py/BBHandler.py')
-rw-r--r--bitbake/lib/bb/parse/parse_py/BBHandler.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/bitbake/lib/bb/parse/parse_py/BBHandler.py b/bitbake/lib/bb/parse/parse_py/BBHandler.py
index ab479c1eb2..1ba81886a7 100644
--- a/bitbake/lib/bb/parse/parse_py/BBHandler.py
+++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py
@@ -80,12 +80,13 @@ def inherit(files, d):
80 include(fn, file, d, "inherit") 80 include(fn, file, d, "inherit")
81 __inherit_cache = data.getVar('__inherit_cache', d) or [] 81 __inherit_cache = data.getVar('__inherit_cache', d) or []
82 82
83def get_statements(filename, absolsute_filename, base_name, file): 83def get_statements(filename, absolsute_filename, base_name):
84 global cached_statements 84 global cached_statements
85 85
86 try: 86 try:
87 return cached_statements[absolsute_filename] 87 return cached_statements[absolsute_filename]
88 except KeyError: 88 except KeyError:
89 file = open(absolsute_filename, 'r')
89 statements = ast.StatementGroup() 90 statements = ast.StatementGroup()
90 91
91 lineno = 0 92 lineno = 0
@@ -133,13 +134,13 @@ def handle(fn, d, include):
133 else: 134 else:
134 oldfile = None 135 oldfile = None
135 136
136 (f, abs_fn) = resolve_file(fn, d) 137 abs_fn = resolve_file(fn, d)
137 138
138 if include: 139 if include:
139 bb.parse.mark_dependency(d, abs_fn) 140 bb.parse.mark_dependency(d, abs_fn)
140 141
141 # actual loading 142 # actual loading
142 statements = get_statements(fn, abs_fn, base_name, f) 143 statements = get_statements(fn, abs_fn, base_name)
143 144
144 # DONE WITH PARSING... time to evaluate 145 # DONE WITH PARSING... time to evaluate
145 if ext != ".bbclass": 146 if ext != ".bbclass":