1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-02 13:29:49 +00:00

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>
This commit is contained in:
Holger Freyther
2009-05-19 13:59:50 +02:00
committed by Richard Purdie
parent 83ec5eaed4
commit 7b57ad901a
3 changed files with 11 additions and 15 deletions
+5 -11
View File
@@ -82,22 +82,16 @@ def init(fn, data):
def resolve_file(fn, d):
if not os.path.isabs(fn):
f = None
bbpath = (bb.data.getVar('BBPATH', d, 1) or '').split(':')
for p in bbpath:
j = os.path.join(p, fn)
if os.access(j, os.R_OK):
abs_fn = j
f = open(j, 'r')
break
if f is None:
raise IOError("file %s not found" % fn)
else:
f = open(fn,'r')
abs_fn = fn
bb.msg.debug(2, bb.msg.domain.Parsing, "LOAD %s" % j)
return j
raise IOError("file %s not found" % fn)
bb.msg.debug(2, bb.msg.domain.Parsing, "LOAD %s" % abs_fn)
return (f, abs_fn)
bb.msg.debug(2, bb.msg.domain.Parsing, "LOAD %s" % fn)
return fn
# Used by OpenEmbedded metadata
__pkgsplit_cache__={}