diff options
author | Cristian Ciocaltea | 2019-11-24 22:30:26 +0200 |
---|---|---|
committer | Simon Glass | 2019-12-10 05:54:55 -0700 |
commit | 4251fbc6fb19cc7406ea450145d307d4b2ec19e9 (patch) | |
tree | 8d84a3b9470808eddde7b69806da91a3b6f52198 /tools/buildman | |
parent | 5e5c785e34a18a12faedc93829e2a88ef22ade2a (diff) |
buildman: Improve [make-flags] section parser to allow quoted strings
The parser responsible for the '[make-flags]' section in
the '.buildman' settings file is currently not able to
handle quoted strings, as given in the sample bellow:
[make-flags]
qemu_arm=HOSTCC="cc -isystem /add/include" HOSTLDFLAGS="-L/add/lib"
This patch replaces the simple string splitter based on the <space>
delimiter with a regex tokenizer that preserves spaces inside double
quoted strings.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
Diffstat (limited to 'tools/buildman')
-rw-r--r-- | tools/buildman/toolchain.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/buildman/toolchain.py b/tools/buildman/toolchain.py index cc26e2ede57..086a4d47cdf 100644 --- a/tools/buildman/toolchain.py +++ b/tools/buildman/toolchain.py @@ -435,9 +435,10 @@ class Toolchains: self._make_flags['target'] = board.target arg_str = self.ResolveReferences(self._make_flags, self._make_flags.get(board.target, '')) - args = arg_str.split(' ') + args = re.findall("(?:\".*?\"|\S)+", arg_str) i = 0 while i < len(args): + args[i] = args[i].replace('"', '') if not args[i]: del args[i] else: |