summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/parse/parse_py/ConfHandler.py
diff options
context:
space:
mode:
authorHolger Freyther <ich@tamarin.(none)>2009-05-17 06:19:39 +0200
committerRichard Purdie <rpurdie@linux.intel.com>2010-02-10 16:31:33 +0000
commit913e78898e65e1d95c6313e86854cdc2ab9e35aa (patch)
tree4ca35dd670b79167b8bdaec9cab1b80e11d1719c /bitbake/lib/bb/parse/parse_py/ConfHandler.py
parent242a03607d752c228e909a65bf4dfbe8661d5355 (diff)
downloadpoky-913e78898e65e1d95c6313e86854cdc2ab9e35aa.tar.gz
bitbake: [parse] Unify opening a file...
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/parse/parse_py/ConfHandler.py')
-rw-r--r--bitbake/lib/bb/parse/parse_py/ConfHandler.py23
1 files changed, 2 insertions, 21 deletions
diff --git a/bitbake/lib/bb/parse/parse_py/ConfHandler.py b/bitbake/lib/bb/parse/parse_py/ConfHandler.py
index fcbf6aea15..ce746106a4 100644
--- a/bitbake/lib/bb/parse/parse_py/ConfHandler.py
+++ b/bitbake/lib/bb/parse/parse_py/ConfHandler.py
@@ -25,7 +25,7 @@
25# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 25# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 26
27import re, bb.data, os, sys 27import re, bb.data, os, sys
28from bb.parse import ParseError 28from bb.parse import ParseError, resolve_file
29 29
30#__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)$") 30#__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)$")
31__config_regexp__ = re.compile( r"(?P<exp>export\s*)?(?P<var>[a-zA-Z0-9\-_+.${}/]+)(\[(?P<flag>[a-zA-Z0-9\-_+.]+)\])?\s*((?P<colon>:=)|(?P<ques>\?=)|(?P<append>\+=)|(?P<prepend>=\+)|(?P<predot>=\.)|(?P<postdot>\.=)|=)\s*(?P<apo>['\"]?)(?P<value>.*)(?P=apo)$") 31__config_regexp__ = re.compile( r"(?P<exp>export\s*)?(?P<var>[a-zA-Z0-9\-_+.${}/]+)(\[(?P<flag>[a-zA-Z0-9\-_+.]+)\])?\s*((?P<colon>:=)|(?P<ques>\?=)|(?P<append>\+=)|(?P<prepend>=\+)|(?P<predot>=\.)|(?P<postdot>\.=)|=)\s*(?P<apo>['\"]?)(?P<value>.*)(?P=apo)$")
@@ -77,10 +77,6 @@ def include(oldfn, fn, data, error_out):
77 bb.msg.debug(2, bb.msg.domain.Parsing, "CONF file '%s' not found" % fn) 77 bb.msg.debug(2, bb.msg.domain.Parsing, "CONF file '%s' not found" % fn)
78 78
79def handle(fn, data, include = 0): 79def handle(fn, data, include = 0):
80 if include:
81 inc_string = "including"
82 else:
83 inc_string = "reading"
84 init(data) 80 init(data)
85 81
86 if include == 0: 82 if include == 0:
@@ -88,22 +84,7 @@ def handle(fn, data, include = 0):
88 else: 84 else:
89 oldfile = bb.data.getVar('FILE', data) 85 oldfile = bb.data.getVar('FILE', data)
90 86
91 if not os.path.isabs(fn): 87 (f, abs_fn) = resolve_file(fn, data)
92 f = None
93 bbpath = bb.data.getVar("BBPATH", data, 1) or []
94 for p in bbpath.split(":"):
95 currname = os.path.join(p, fn)
96 if os.access(currname, os.R_OK):
97 f = open(currname, 'r')
98 abs_fn = currname
99 bb.msg.debug(2, bb.msg.domain.Parsing, "CONF %s %s" % (inc_string, currname))
100 break
101 if f is None:
102 raise IOError("file '%s' not found" % fn)
103 else:
104 f = open(fn,'r')
105 bb.msg.debug(1, bb.msg.domain.Parsing, "CONF %s %s" % (inc_string,fn))
106 abs_fn = fn
107 88
108 if include: 89 if include:
109 bb.parse.mark_dependency(data, abs_fn) 90 bb.parse.mark_dependency(data, abs_fn)