summaryrefslogtreecommitdiffstats
path: root/lib/bb/parse/parse_py/BBHandler.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bb/parse/parse_py/BBHandler.py')
-rw-r--r--lib/bb/parse/parse_py/BBHandler.py29
1 files changed, 18 insertions, 11 deletions
diff --git a/lib/bb/parse/parse_py/BBHandler.py b/lib/bb/parse/parse_py/BBHandler.py
index 118911434..18e686838 100644
--- a/lib/bb/parse/parse_py/BBHandler.py
+++ b/lib/bb/parse/parse_py/BBHandler.py
@@ -44,17 +44,24 @@ def inherit(files, fn, lineno, d):
__inherit_cache = d.getVar('__inherit_cache', False) or []
files = d.expand(files).split()
for file in files:
- 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):
- bbpath = d.getVar("BBPATH")
- abs_fn, attempts = bb.utils.which(bbpath, file, history=True)
- for af in attempts:
- if af != abs_fn:
- bb.parse.mark_dependency(d, af)
- if abs_fn:
- file = abs_fn
+ classtype = d.getVar("__bbclasstype", False)
+ origfile = file
+ for t in ["classes-" + classtype, "classes"]:
+ file = origfile
+ if not os.path.isabs(file) and not file.endswith(".bbclass"):
+ file = os.path.join(t, '%s.bbclass' % file)
+
+ if not os.path.isabs(file):
+ bbpath = d.getVar("BBPATH")
+ abs_fn, attempts = bb.utils.which(bbpath, file, history=True)
+ for af in attempts:
+ if af != abs_fn:
+ bb.parse.mark_dependency(d, af)
+ if abs_fn:
+ file = abs_fn
+
+ if os.path.exists(file):
+ break
if not os.path.exists(file):
raise ParseError("Could not inherit file %s" % (file), fn, lineno)