summaryrefslogtreecommitdiff
path: root/buildstream/_options
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-04-06 17:30:25 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-04-06 17:36:42 +0900
commit550cb369e04a16c38e3b4f0656c3d25f952ceee1 (patch)
tree681497e903da265f3a453d6a9ac19f7b02770f44 /buildstream/_options
parent337075bb0b244756ed809e981be8ed91c77bff23 (diff)
downloadbuildstream-550cb369e04a16c38e3b4f0656c3d25f952ceee1.tar.gz
_options/option.py: Assert valid symbol names for variable exports
Diffstat (limited to 'buildstream/_options')
-rw-r--r--buildstream/_options/option.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/buildstream/_options/option.py b/buildstream/_options/option.py
index 05c56e582..dfc8d4040 100644
--- a/buildstream/_options/option.py
+++ b/buildstream/_options/option.py
@@ -64,6 +64,11 @@ class Option():
self.description = _yaml.node_get(node, str, 'description')
self.variable = _yaml.node_get(node, str, 'variable', default_value='') or None
+ # Assert valid symbol name for variable name
+ if self.variable:
+ p = _yaml.node_get_provenance(node, 'variable')
+ _yaml.assert_symbol_name(p, self.variable, 'variable name')
+
# load_value()
#
# Loads the value of the option in string form.