]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
Make the bbpath change for includes temporary rather than permanent.
authorChris Larson <clarson@kergoth.com>
Wed, 8 Apr 2009 17:35:38 +0000 (17:35 +0000)
committerChris Larson <clarson@kergoth.com>
Wed, 8 Apr 2009 17:35:38 +0000 (17:35 +0000)
We currently modify BBPATH so that an include/require looks in the current
working directory before it looks elsewhere.  Modifying it permanently
doesn't gain anything, just polluting it with locations that don't need to
stay there.

Signed-off-by: Chris Larson <clarson@mvista.com>
lib/bb/parse/parse_py/BBHandler.py
lib/bb/parse/parse_py/ConfHandler.py

index 00ad6ef4fec39a5664aedca6cadca80a29e14236..453a8956e37c535e6b455a85c4b1806d1d720ebf 100644 (file)
@@ -155,12 +155,6 @@ def handle(fn, d, include = 0):
         f = open(fn,'r')
         abs_fn = fn
 
-    if ext != ".bbclass":
-        dname = os.path.dirname(abs_fn)
-        if dname not in bbpath:
-            bbpath.insert(0, dname)
-            data.setVar('BBPATH', ":".join(bbpath), d)
-
     if include:
         bb.parse.mark_dependency(d, abs_fn)
 
index f8a49689e2f7119f3b8ae2f41ad5d6e0734683f5..c9f1ea13fb7d99b23a260e366d5238a4272453cf 100644 (file)
@@ -102,6 +102,13 @@ def include(oldfn, fn, data, error_out):
     fn = bb.data.expand(fn, data)
     oldfn = bb.data.expand(oldfn, data)
 
+    if not os.path.isabs(fn):
+        dname = os.path.dirname(oldfn)
+        bbpath = "%s:%s" % (dname, bb.data.getVar("BBPATH", data, 1))
+        abs_fn = bb.which(bbpath, fn)
+        if abs_fn:
+            fn = abs_fn
+
     from bb.parse import handle
     try:
         ret = handle(fn, data, True)