]> code.ossystems Code Review - openembedded-core.git/commitdiff
bitbake: [parse] Use bb.which in resolve_file
authorChris Larson <clarson@kergoth.com>
Sun, 19 Jul 2009 05:36:32 +0000 (22:36 -0700)
committerRichard Purdie <rpurdie@linux.intel.com>
Mon, 15 Feb 2010 17:07:56 +0000 (17:07 +0000)
(Bitbake rev: 3cd06ed487ee0617892f154cff461379a323a1fb)

Signed-off-by: Chris Larson <clarson@kergoth.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
bitbake/lib/bb/parse/__init__.py

index 5e74afd9ac0f4d8e4e9ce329ebe5c1f2c54d50f7..2a7897cdf27e38a312cf889e1bc2dc954d9f8504 100644 (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