diff options
Diffstat (limited to 'bitbake/lib/bb/parse')
-rw-r--r-- | bitbake/lib/bb/parse/ast.py | 33 | ||||
-rw-r--r-- | bitbake/lib/bb/parse/parse_py/ConfHandler.py | 12 |
2 files changed, 45 insertions, 0 deletions
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py index 0fc3a9e7a4..d7185b1664 100644 --- a/bitbake/lib/bb/parse/ast.py +++ b/bitbake/lib/bb/parse/ast.py | |||
@@ -69,6 +69,33 @@ class ExportNode(AstNode): | |||
69 | def eval(self, data): | 69 | def eval(self, data): |
70 | data.setVarFlag(self.var, "export", 1, op = 'exported') | 70 | data.setVarFlag(self.var, "export", 1, op = 'exported') |
71 | 71 | ||
72 | class UnsetNode(AstNode): | ||
73 | def __init__(self, filename, lineno, var): | ||
74 | AstNode.__init__(self, filename, lineno) | ||
75 | self.var = var | ||
76 | |||
77 | def eval(self, data): | ||
78 | loginfo = { | ||
79 | 'variable': self.var, | ||
80 | 'file': self.filename, | ||
81 | 'line': self.lineno, | ||
82 | } | ||
83 | data.delVar(self.var,**loginfo) | ||
84 | |||
85 | class UnsetFlagNode(AstNode): | ||
86 | def __init__(self, filename, lineno, var, flag): | ||
87 | AstNode.__init__(self, filename, lineno) | ||
88 | self.var = var | ||
89 | self.flag = flag | ||
90 | |||
91 | def eval(self, data): | ||
92 | loginfo = { | ||
93 | 'variable': self.var, | ||
94 | 'file': self.filename, | ||
95 | 'line': self.lineno, | ||
96 | } | ||
97 | data.delVarFlag(self.var, self.flag, **loginfo) | ||
98 | |||
72 | class DataNode(AstNode): | 99 | class DataNode(AstNode): |
73 | """ | 100 | """ |
74 | Various data related updates. For the sake of sanity | 101 | Various data related updates. For the sake of sanity |
@@ -270,6 +297,12 @@ def handleInclude(statements, filename, lineno, m, force): | |||
270 | def handleExport(statements, filename, lineno, m): | 297 | def handleExport(statements, filename, lineno, m): |
271 | statements.append(ExportNode(filename, lineno, m.group(1))) | 298 | statements.append(ExportNode(filename, lineno, m.group(1))) |
272 | 299 | ||
300 | def handleUnset(statements, filename, lineno, m): | ||
301 | statements.append(UnsetNode(filename, lineno, m.group(1))) | ||
302 | |||
303 | def handleUnsetFlag(statements, filename, lineno, m): | ||
304 | statements.append(UnsetFlagNode(filename, lineno, m.group(1), m.group(2))) | ||
305 | |||
273 | def handleData(statements, filename, lineno, groupd): | 306 | def handleData(statements, filename, lineno, groupd): |
274 | statements.append(DataNode(filename, lineno, groupd)) | 307 | statements.append(DataNode(filename, lineno, groupd)) |
275 | 308 | ||
diff --git a/bitbake/lib/bb/parse/parse_py/ConfHandler.py b/bitbake/lib/bb/parse/parse_py/ConfHandler.py index b9712929f3..875250de40 100644 --- a/bitbake/lib/bb/parse/parse_py/ConfHandler.py +++ b/bitbake/lib/bb/parse/parse_py/ConfHandler.py | |||
@@ -57,6 +57,8 @@ __config_regexp__ = re.compile( r""" | |||
57 | __include_regexp__ = re.compile( r"include\s+(.+)" ) | 57 | __include_regexp__ = re.compile( r"include\s+(.+)" ) |
58 | __require_regexp__ = re.compile( r"require\s+(.+)" ) | 58 | __require_regexp__ = re.compile( r"require\s+(.+)" ) |
59 | __export_regexp__ = re.compile( r"export\s+([a-zA-Z0-9\-_+.${}/]+)$" ) | 59 | __export_regexp__ = re.compile( r"export\s+([a-zA-Z0-9\-_+.${}/]+)$" ) |
60 | __unset_regexp__ = re.compile( r"unset\s+([a-zA-Z0-9\-_+.${}/]+)$" ) | ||
61 | __unset_flag_regexp__ = re.compile( r"unset\s+([a-zA-Z0-9\-_+.${}/]+)\[([a-zA-Z0-9\-_+.${}/]+)\]$" ) | ||
60 | 62 | ||
61 | def init(data): | 63 | def init(data): |
62 | topdir = data.getVar('TOPDIR', False) | 64 | topdir = data.getVar('TOPDIR', False) |
@@ -185,6 +187,16 @@ def feeder(lineno, s, fn, statements): | |||
185 | ast.handleExport(statements, fn, lineno, m) | 187 | ast.handleExport(statements, fn, lineno, m) |
186 | return | 188 | return |
187 | 189 | ||
190 | m = __unset_regexp__.match(s) | ||
191 | if m: | ||
192 | ast.handleUnset(statements, fn, lineno, m) | ||
193 | return | ||
194 | |||
195 | m = __unset_flag_regexp__.match(s) | ||
196 | if m: | ||
197 | ast.handleUnsetFlag(statements, fn, lineno, m) | ||
198 | return | ||
199 | |||
188 | raise ParseError("unparsed line: '%s'" % s, fn, lineno); | 200 | raise ParseError("unparsed line: '%s'" % s, fn, lineno); |
189 | 201 | ||
190 | # Add us to the handlers list | 202 | # Add us to the handlers list |