summaryrefslogtreecommitdiff
path: root/bitbake/lib/bb/parse/parse_py/ConfHandler.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/parse/parse_py/ConfHandler.py')
-rw-r--r--bitbake/lib/bb/parse/parse_py/ConfHandler.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/bitbake/lib/bb/parse/parse_py/ConfHandler.py b/bitbake/lib/bb/parse/parse_py/ConfHandler.py
index f4f85de24..9128a2ef8 100644
--- a/bitbake/lib/bb/parse/parse_py/ConfHandler.py
+++ b/bitbake/lib/bb/parse/parse_py/ConfHandler.py
@@ -10,7 +10,7 @@
# Copyright (C) 2003, 2004 Chris Larson
# Copyright (C) 2003, 2004 Phil Blundell
-#
+#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
@@ -24,7 +24,8 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-import re, bb.data, os, sys
+import re, bb.data, os
+import bb.utils
from bb.parse import ParseError, resolve_file, ast
#__config_regexp__ = re.compile( r"(?P<exp>export\s*)?(?P<var>[a-zA-Z0-9\-_+.${}]+)\s*(?P<colon>:)?(?P<ques>\?)?=\s*(?P<apo>['\"]?)(?P<value>.*)(?P=apo)$")
@@ -36,10 +37,7 @@ __export_regexp__ = re.compile( r"export\s+(.+)" )
def init(data):
topdir = bb.data.getVar('TOPDIR', data)
if not topdir:
- topdir = os.getcwd()
- bb.data.setVar('TOPDIR', topdir, data)
- if not bb.data.getVar('BBPATH', data):
- bb.fatal("The BBPATH environment variable must be set")
+ bb.data.setVar('TOPDIR', os.getcwd(), data)
def supports(fn, d):
@@ -60,7 +58,7 @@ def include(oldfn, fn, data, error_out):
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)
+ abs_fn = bb.utils.which(bbpath, fn)
if abs_fn:
fn = abs_fn
@@ -88,7 +86,7 @@ def handle(fn, data, include):
statements = ast.StatementGroup()
lineno = 0
- while 1:
+ while True:
lineno = lineno + 1
s = f.readline()
if not s: break