summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/parse/parse_py/BBHandler.py
diff options
context:
space:
mode:
authorHolger Freyther <ich@tamarin.(none)>2009-05-17 06:19:39 +0200
committerRichard Purdie <rpurdie@linux.intel.com>2010-02-10 16:31:33 +0000
commit913e78898e65e1d95c6313e86854cdc2ab9e35aa (patch)
tree4ca35dd670b79167b8bdaec9cab1b80e11d1719c /bitbake/lib/bb/parse/parse_py/BBHandler.py
parent242a03607d752c228e909a65bf4dfbe8661d5355 (diff)
downloadpoky-913e78898e65e1d95c6313e86854cdc2ab9e35aa.tar.gz
bitbake: [parse] Unify opening a file...
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.py18
1 files changed, 2 insertions, 16 deletions
diff --git a/bitbake/lib/bb/parse/parse_py/BBHandler.py b/bitbake/lib/bb/parse/parse_py/BBHandler.py
index 7707705aaf..c6931650da 100644
--- a/bitbake/lib/bb/parse/parse_py/BBHandler.py
+++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py
@@ -30,7 +30,7 @@ import bb.fetch, bb.build, bb.utils
30from bb import data, fetch, methodpool 30from bb import data, fetch, methodpool
31 31
32from ConfHandler import include, init 32from ConfHandler import include, init
33from bb.parse import ParseError 33from bb.parse import ParseError, resolve_file
34 34
35__func_start_regexp__ = re.compile( r"(((?P<py>python)|(?P<fr>fakeroot))\s*)*(?P<func>[\w\.\-\+\{\}\$]+)?\s*\(\s*\)\s*{$" ) 35__func_start_regexp__ = re.compile( r"(((?P<py>python)|(?P<fr>fakeroot))\s*)*(?P<func>[\w\.\-\+\{\}\$]+)?\s*\(\s*\)\s*{$" )
36__inherit_regexp__ = re.compile( r"inherit\s+(.+)" ) 36__inherit_regexp__ = re.compile( r"inherit\s+(.+)" )
@@ -145,20 +145,7 @@ def handle(fn, d, include = 0):
145 else: 145 else:
146 oldfile = None 146 oldfile = None
147 147
148 bbpath = (data.getVar('BBPATH', d, 1) or '').split(':') 148 (f, abs_fn) = resolve_file(fn, d)
149 if not os.path.isabs(fn):
150 f = None
151 for p in bbpath:
152 j = os.path.join(p, fn)
153 if os.access(j, os.R_OK):
154 abs_fn = j
155 f = open(j, 'r')
156 break
157 if f is None:
158 raise IOError("file %s not found" % fn)
159 else:
160 f = open(fn,'r')
161 abs_fn = fn
162 149
163 if include: 150 if include:
164 bb.parse.mark_dependency(d, abs_fn) 151 bb.parse.mark_dependency(d, abs_fn)
@@ -203,7 +190,6 @@ def handle(fn, d, include = 0):
203 darray[cls] = based 190 darray[cls] = based
204 return darray 191 return darray
205 192
206 bbpath.pop(0)
207 if oldfile: 193 if oldfile:
208 bb.data.setVar("FILE", oldfile, d) 194 bb.data.setVar("FILE", oldfile, d)
209 195