summaryrefslogtreecommitdiffstats
path: root/lib/bb/parse/__init__.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-12 22:59:49 +0000
commit9c8bd8f6e4817d567fad1ce78238563dd426a835 (patch)
treef4470f4b3ab11c2d72bee559203e4b5f6284be78 /lib/bb/parse/__init__.py
parent8cc26d4bf4b854bd731ce4798832903102f4baf5 (diff)
downloadbitbake-contrib-9c8bd8f6e4817d567fad1ce78238563dd426a835.tar.gz
[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.
Diffstat (limited to 'lib/bb/parse/__init__.py')
-rw-r--r--lib/bb/parse/__init__.py18
1 files changed, 6 insertions, 12 deletions
diff --git a/lib/bb/parse/__init__.py b/lib/bb/parse/__init__.py
index 6737e061e..5e74afd9a 100644
--- a/lib/bb/parse/__init__.py
+++ b/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__={}