diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2020-09-14 10:07:15 -0700 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2020-10-05 08:59:45 -0400 |
commit | 4b1c1d83c88853a6be99b53e4d27c414b7b36137 (patch) | |
tree | 019ab6975511f521db01a6046aa091fae5596eca /mesonbuild | |
parent | 30a102d9a3d4594bb757b28e5b6796e327393eef (diff) | |
download | meson-4b1c1d83c88853a6be99b53e4d27c414b7b36137.zip meson-4b1c1d83c88853a6be99b53e4d27c414b7b36137.tar.gz meson-4b1c1d83c88853a6be99b53e4d27c414b7b36137.tar.bz2 |
machinefiles: Allow keys to be stored case insensitive
This is required to make the various keys in the [user options] section
work the same as they do in the meson_options.txt file, where we don't
have any rules about case sensitivity.
There is some risk here. Someone may be relying on this lower by default
behavior, and this could break their machine files.
Fixes #7731
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/coredata.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py index 710d8c9..4be828b 100644 --- a/mesonbuild/coredata.py +++ b/mesonbuild/coredata.py @@ -850,13 +850,17 @@ class CoreData: mlog.warning('Please see https://mesonbuild.com/Builtin-options.html#Notes_about_Apple_Bitcode_support for more details.', fatal=False) class CmdLineFileParser(configparser.ConfigParser): - def __init__(self): + def __init__(self) -> None: # We don't want ':' as key delimiter, otherwise it would break when # storing subproject options like "subproject:option=value" super().__init__(delimiters=['='], interpolation=None) + def optionxform(self, option: str) -> str: + # Don't call str.lower() on keys + return option + class MachineFileParser(): - def __init__(self, filenames: T.List[str]): + def __init__(self, filenames: T.List[str]) -> None: self.parser = CmdLineFileParser() self.constants = {'True': True, 'False': False} self.sections = {} |