Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix prep-perpatch-check-cmd in .b4-config
Trying to use the 'prep-perpatch-check-cmd' config from a repo with '.b4-config' fails. For example as follows $ b4 --version 0.14.0 $ printf '[b4]\n\tprep-perpatch-check-cmd = "true"\n' >.b4-config \ && git add .b4-config && git commit -m b4-test $ b4 prep --check Checking patches using: t r u e --- Traceback (most recent call last): File "/home/blmaier/.local/bin/b4", line 8, in <module> sys.exit(cmd()) ^^^^^ File "/home/blmaier/.local/lib/python3.12/site-packages/b4/command.py", line 417, in cmd cmdargs.func(cmdargs) File "/home/blmaier/.local/lib/python3.12/site-packages/b4/command.py", line 83, in cmd_prep b4.ez.cmd_prep(cmdargs) File "/home/blmaier/.local/lib/python3.12/site-packages/b4/ez.py", line 2822, in cmd_prep return check(cmdargs) ^^^^^^^^^^^^^^ File "/home/blmaier/.local/lib/python3.12/site-packages/b4/ez.py", line 1707, in check ckrep = b4.LoreMessage.run_local_check(ppcmdargs, commit, msg, nocache=cmdargs.nocache) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/blmaier/.local/lib/python3.12/site-packages/b4/__init__.py", line 1522, in run_local_check ecode, out, err = _run_command(cmdargs, stdin=bdata, rundir=topdir) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/blmaier/.local/lib/python3.12/site-packages/b4/__init__.py", line 2650, in _run_command sp = subprocess.Popen(cmdargs, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.12/subprocess.py", line 1026, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib64/python3.12/subprocess.py", line 1955, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 't' The problem is 'prep-perpatch-check-cmd' is the special 'multival' type (Python list). But when the .b4-config is imported it does not specify the multival types, so it gets imported as a string. When b4 tries to call the check-cmd later on, it gets iterated over as if it were a list but instead returns each character. Signed-off-by: Brandon Maier <brandon.maier@collins.com> Link: https://patch.msgid.link/20240626-b4-config-check-cmd-v1-1-83fc971196f9@collins.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org> (cherry picked from commit d5f3956)
- Loading branch information