diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-12-11 00:02:50 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-12-11 15:59:28 +0000 |
commit | f3a71e509af196391ec126d079cf1bd178e62ad5 (patch) | |
tree | b3497729bb3ec952296a38e4375d1324fe204961 /lib/bb/parse/parse_py/BBHandler.py | |
parent | 9fc98f96f0e0320beda0ce9546275a99336732c1 (diff) | |
download | bitbake-contrib-f3a71e509af196391ec126d079cf1bd178e62ad5.tar.gz |
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.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/parse/parse_py/BBHandler.py')
-rw-r--r-- | lib/bb/parse/parse_py/BBHandler.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/bb/parse/parse_py/BBHandler.py b/lib/bb/parse/parse_py/BBHandler.py index 92c55f531..e6039e11a 100644 --- a/lib/bb/parse/parse_py/BBHandler.py +++ b/lib/bb/parse/parse_py/BBHandler.py @@ -74,6 +74,13 @@ def inherit(files, fn, lineno, d): if not os.path.isabs(file) and not file.endswith(".bbclass"): file = os.path.join('classes', '%s.bbclass' % file) + if not os.path.isabs(file): + dname = os.path.dirname(fn) + bbpath = "%s:%s" % (dname, d.getVar("BBPATH", True)) + abs_fn = bb.utils.which(bbpath, file) + if abs_fn: + file = abs_fn + if not file in __inherit_cache: logger.log(logging.DEBUG -1, "BB %s:%d: inheriting %s", fn, lineno, file) __inherit_cache.append( file ) |