[PATCH] cmdline-gen: fix error when command list has empty lines
Thomas Monjalon
thomas at monjalon.net
Mon Nov 20 13:47:52 CET 2023
17/11/2023 12:22, Bruce Richardson:
> On Thu, Nov 16, 2023 at 12:18:13PM +0100, Robin Jarry wrote:
> > Fix the following error when a command list file contains empty lines:
> >
> > Traceback (most recent call last):
> > File "buildtools/dpdk-cmdline-gen.py", line 202, in <module>
> > main()
> > File "buildtools/dpdk-cmdline-gen.py", line 184, in main
> > process_commands(args.infile, sys.stdout, None, args.context_name)
> > File "buildtools/dpdk-cmdline-gen.py", line 141, in process_commands
> > cmd_inst, h_out, c_out = process_command(lineno, tokens.strip().spl…
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^…
> > File "buildtools/dpdk-cmdline-gen.py", line 36, in process_command
> > if tokens[0].startswith("<"):
> > ~~~~~~^^^
> > IndexError: list index out of range
> >
> > Use shlex.split() to properly split each line arguments into tokens and
> > strip comments.
> >
> > If there are no tokens, ignore the line.
> >
> > Fixes: 37666691e9ed ("buildtools: add a tool to generate cmdline boilerplate")
> >
> > Cc: Bruce Richardson <bruce.richardson at intel.com>
> > Signed-off-by: Robin Jarry <rjarry at redhat.com>
> > ---
>
> LGTM, thanks.
>
> Acked-by: Bruce Richardson <bruce.richardson at intel.com>
Applied, thanks.
More information about the dev
mailing list