diff options
author | Muhammad Sulthan Mazaya <msulthanmazaya@gmail.com> | 2023-06-20 08:47:00 +1000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2023-06-21 09:09:06 +1000 |
commit | 60e793a17c3847f0a297bb593c1eda9c73e2df52 (patch) | |
tree | fb49c95a96cf0517f5d73cb3c2e8667e88a4b563 | |
parent | rtemstoolkit: add support for executing pipe command (diff) | |
download | rtems-tools-60e793a17c3847f0a297bb593c1eda9c73e2df52.tar.bz2 |
tester/rt: use shlex.split to split command args
The regular split-by-space function used to split command arguments
creates compatibility issues with many shell command syntaxes. A
specific example is the handling of string arguments, as shown below:
%define renode_args -e start_opts -e "s %{bsp_resc_script}"
Thus, it is changed to use shlex.split instead. It splits
the command arguments using shell-like syntax. More about shlex
module here: https://docs.python.org/3/library/shlex.html
-rw-r--r-- | tester/rt/config.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tester/rt/config.py b/tester/rt/config.py index 8a433af..c0c31de 100644 --- a/tester/rt/config.py +++ b/tester/rt/config.py @@ -37,6 +37,7 @@ from __future__ import print_function import datetime import os import re +import shlex import threading from rtemstoolkit import configuration @@ -326,7 +327,7 @@ class file(config.file): if len(_data): ds = [_data[0]] if len(_data) > 1: - ds += _data[1].split() + ds += shlex.split(_data[1], posix=False) ds = self.expand(ds) if _directive == '%console': |