summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/parse/parse_py
diff options
context:
space:
mode:
authorJérémy Rosen <jeremy.rosen@smile.fr>2016-08-16 14:04:47 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-18 10:06:26 +0100
commit0eb6d709b6c38aa27f33d8b0ef977a33350f0d75 (patch)
treef4b503fb079669fdc021f9b7a78f6d814862d7f4 /bitbake/lib/bb/parse/parse_py
parentb50b14e37249fb23b8e4f3a86f9b245cba85ca86 (diff)
downloadpoky-0eb6d709b6c38aa27f33d8b0ef977a33350f0d75.tar.gz
bitbake: ast/ConfHandler: Add a syntax to clear variable
unset VAR will clear variable VAR unset VAR[flag] will clear flag "flag" from var VAR (Bitbake rev: bedbd46ece8d1285b5cd2ea07dc64b4875b479aa) Signed-off-by: Jérémy Rosen <jeremy.rosen@openwide.fr> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/parse/parse_py')
-rw-r--r--bitbake/lib/bb/parse/parse_py/ConfHandler.py12
1 files changed, 12 insertions, 0 deletions
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
61def init(data): 63def 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