[PATCH 14/25] patman: Enhance implementation of file-based defaults

Simon Glass sjg at chromium.org
Sat May 24 07:06:05 CEST 2025


Patman allows defaults for its command-line flags to be read from a
file. The implementation of this does not fully work with subcommands,
since we don't want a default for those.

Also, it relies on being able to parse any sort of cmdline in order to
figure out the options that are available. But in some cases, the
cmdline may not parse, e.g. if there are required options, or
conflicting options.

Add a class which can be safely used to parse any cmdline, since it
allows execution to continue even when errors are obtained. Use this to
determine the defaults, being careful to skip sub/commands.

Another way to handle all of this would be to maintain the defaults
separately and insert them into the parser manually. For now, I'm not
sure which is best.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 tools/patman/cmdline.py  | 21 ++++++++++++++++-
 tools/patman/settings.py | 50 ++++++++++++++++++++++++++++++++++++----
 2 files changed, 65 insertions(+), 6 deletions(-)

Applied to sjg/master, thanks!


More information about the U-Boot mailing list