summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-12-11 00:02:50 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-12-11 15:59:42 +0000
commit3dc3fe32e315ecab35912dd8389626bea695f96f (patch)
tree3036d015f6120c298730577cc4f145fb693799c4 /bitbake/lib
parent8ead7dc3cc1b0c878f246ea233e34d58a74a66db (diff)
downloadpoky-3dc3fe32e315ecab35912dd8389626bea695f96f.tar.gz
bitbake: BBhandler/data: Fix __inherit_cache duplication
The inherits cache contains duplicate entries, some with the full patch, some just starting classes/xxx. This is a waste of parse time and potentially error prone. This patch fixes various pieces of code so the absolute paths are always preferred and work correctly. The inherits_class function did not work with full paths so the patch fixes this. (Bitbake rev: f3a71e509af196391ec126d079cf1bd178e62ad5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/data.py6
-rw-r--r--bitbake/lib/bb/parse/parse_py/BBHandler.py7
2 files changed, 11 insertions, 2 deletions
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py
index 9a32353d68..dc5a425d1c 100644
--- a/bitbake/lib/bb/data.py
+++ b/bitbake/lib/bb/data.py
@@ -357,6 +357,8 @@ def generate_dependencies(d):
357 357
358def inherits_class(klass, d): 358def inherits_class(klass, d):
359 val = getVar('__inherit_cache', d) or [] 359 val = getVar('__inherit_cache', d) or []
360 if os.path.join('classes', '%s.bbclass' % klass) in val: 360 needle = os.path.join('classes', '%s.bbclass' % klass)
361 return True 361 for v in val:
362 if v.endswith(needle):
363 return True
362 return False 364 return False
diff --git a/bitbake/lib/bb/parse/parse_py/BBHandler.py b/bitbake/lib/bb/parse/parse_py/BBHandler.py
index 92c55f531a..e6039e11a2 100644
--- a/bitbake/lib/bb/parse/parse_py/BBHandler.py
+++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py
@@ -74,6 +74,13 @@ def inherit(files, fn, lineno, d):
74 if not os.path.isabs(file) and not file.endswith(".bbclass"): 74 if not os.path.isabs(file) and not file.endswith(".bbclass"):
75 file = os.path.join('classes', '%s.bbclass' % file) 75 file = os.path.join('classes', '%s.bbclass' % file)
76 76
77 if not os.path.isabs(file):
78 dname = os.path.dirname(fn)
79 bbpath = "%s:%s" % (dname, d.getVar("BBPATH", True))
80 abs_fn = bb.utils.which(bbpath, file)
81 if abs_fn:
82 file = abs_fn
83
77 if not file in __inherit_cache: 84 if not file in __inherit_cache:
78 logger.log(logging.DEBUG -1, "BB %s:%d: inheriting %s", fn, lineno, file) 85 logger.log(logging.DEBUG -1, "BB %s:%d: inheriting %s", fn, lineno, file)
79 __inherit_cache.append( file ) 86 __inherit_cache.append( file )