From 8ee9365717d544c5e51ccd3daf44f0c39b818057 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Fri, 24 Mar 2017 21:25:26 +0530 Subject: Allow option values to contain ':' Instead, check that option keys don't contain ':'. Also change the failing option test to look for this. Closes https://github.com/mesonbuild/meson/issues/1454 --- mesonbuild/optinterpreter.py | 7 ++++--- test cases/failing/14 invalid option name/meson_options.txt | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mesonbuild/optinterpreter.py b/mesonbuild/optinterpreter.py index 10b8fab37..f9e7f26e7 100644 --- a/mesonbuild/optinterpreter.py +++ b/mesonbuild/optinterpreter.py @@ -75,15 +75,16 @@ class OptionInterpreter: self.cmd_line_options = {} for o in command_line_options: if self.subproject != '': # Strip the beginning. + # Ignore options that aren't for this subproject if not o.startswith(self.sbprefix): continue - else: - if ':' in o: - continue try: (key, value) = o.split('=', 1) except ValueError: raise OptionException('Option {!r} must have a value separated by equals sign.'.format(o)) + # Ignore subproject options if not fetching subproject options + if self.subproject == '' and ':' in key: + continue self.cmd_line_options[key] = value def process(self, option_file): diff --git a/test cases/failing/14 invalid option name/meson_options.txt b/test cases/failing/14 invalid option name/meson_options.txt index c65640256..aab6ae8de 100644 --- a/test cases/failing/14 invalid option name/meson_options.txt +++ b/test cases/failing/14 invalid option name/meson_options.txt @@ -1 +1 @@ -option('invalid/name', type : 'boolean', value : false) \ No newline at end of file +option('invalid:name', type : 'boolean', value : false) -- cgit v1.2.3