diff options
Diffstat (limited to 'bitbake/lib/bb/parse/parse_py/ConfHandler.py')
-rw-r--r-- | bitbake/lib/bb/parse/parse_py/ConfHandler.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/bitbake/lib/bb/parse/parse_py/ConfHandler.py b/bitbake/lib/bb/parse/parse_py/ConfHandler.py index c9f1ea13fb..23316ada58 100644 --- a/bitbake/lib/bb/parse/parse_py/ConfHandler.py +++ b/bitbake/lib/bb/parse/parse_py/ConfHandler.py | |||
@@ -34,10 +34,17 @@ __require_regexp__ = re.compile( r"require\s+(.+)" ) | |||
34 | __export_regexp__ = re.compile( r"export\s+(.+)" ) | 34 | __export_regexp__ = re.compile( r"export\s+(.+)" ) |
35 | 35 | ||
36 | def init(data): | 36 | def init(data): |
37 | if not bb.data.getVar('TOPDIR', data): | 37 | topdir = bb.data.getVar('TOPDIR', data) |
38 | bb.data.setVar('TOPDIR', os.getcwd(), data) | 38 | if not topdir: |
39 | topdir = os.getcwd() | ||
40 | bb.data.setVar('TOPDIR', topdir, data) | ||
39 | if not bb.data.getVar('BBPATH', data): | 41 | if not bb.data.getVar('BBPATH', data): |
40 | bb.data.setVar('BBPATH', os.path.join(sys.prefix, 'share', 'bitbake'), data) | 42 | from pkg_resources import Requirement, resource_filename |
43 | bitbake = Requirement.parse("bitbake") | ||
44 | datadir = resource_filename(bitbake, "../share/bitbake") | ||
45 | basedir = resource_filename(bitbake, "..") | ||
46 | bb.data.setVar('BBPATH', '%s:%s:%s' % (topdir, datadir, basedir), data) | ||
47 | |||
41 | 48 | ||
42 | def supports(fn, d): | 49 | def supports(fn, d): |
43 | return localpath(fn, d)[-5:] == ".conf" | 50 | return localpath(fn, d)[-5:] == ".conf" |