diff options
author | Holger Freyther <ich@tamarin.(none)> | 2009-05-19 13:59:50 +0200 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-02-15 17:07:55 +0000 |
commit | 7b57ad901af2ded02995d22718ec6f280a9edd7f (patch) | |
tree | 81b9b3909460269bdd60744a255ac923775fa71c /bitbake/lib/bb/parse/__init__.py | |
parent | 83ec5eaed411225d16a4fc4dc92323e3acc9f5cd (diff) | |
download | ast2050-yocto-poky-7b57ad901af2ded02995d22718ec6f280a9edd7f.zip ast2050-yocto-poky-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/__init__.py')
-rw-r--r-- | bitbake/lib/bb/parse/__init__.py | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/bitbake/lib/bb/parse/__init__.py b/bitbake/lib/bb/parse/__init__.py index 6737e06..5e74afd 100644 --- a/bitbake/lib/bb/parse/__init__.py +++ b/bitbake/lib/bb/parse/__init__.py @@ -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" % abs_fn) - return (f, abs_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" % fn) + return fn # Used by OpenEmbedded metadata __pkgsplit_cache__={} |