bitbake: [parse] Use bb.which in resolve_file

(Bitbake rev: 3cd06ed487ee0617892f154cff461379a323a1fb)

Signed-off-by: Chris Larson <clarson@kergoth.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
Chris Larson 2009-07-18 22:36:32 -07:00 committed by Richard Purdie
parent 7b57ad901a
commit c675bfd5bf
1 changed files with 3 additions and 7 deletions

View File

@ -82,13 +82,9 @@ def init(fn, data):
def resolve_file(fn, d):
if not os.path.isabs(fn):
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):
bb.msg.debug(2, bb.msg.domain.Parsing, "LOAD %s" % j)
return j
raise IOError("file %s not found" % fn)
fn = bb.which(bb.data.getVar("BBPATH", d, 1), fn)
if not fn:
raise IOError("file %s not found" % fn)
bb.msg.debug(2, bb.msg.domain.Parsing, "LOAD %s" % fn)
return fn