[PATCH v6 16/21] binman: Add BintoolPacker class to bintool
Simon Glass
sjg at chromium.org
Sat Aug 20 23:33:45 CEST 2022
Hi Stefan,
On Fri, 19 Aug 2022 at 08:26, Stefan Herbrechtsmeier
<stefan.herbrechtsmeier-oss at weidmueller.com> wrote:
>
> From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier at weidmueller.com>
>
> Add a bintools base class for packers which compression / decompression
> entry contents.
>
> Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier at weidmueller.com>
>
> ---
>
> (no changes since v5)
>
> Changes in v5:
> - Remove self.fetch_package not None check in fetch function
>
> Changes in v3:
> - Document class properties
>
> Changes in v2:
> - Add commit to add BintoolPacker class to bintool
>
> tools/binman/bintool.py | 106 ++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 106 insertions(+)
>
Reviewed-by: Simon Glass <sjg at chromium.org>
> diff --git a/tools/binman/bintool.py b/tools/binman/bintool.py
> index 8435b29749..ccc1904d62 100644
> --- a/tools/binman/bintool.py
> +++ b/tools/binman/bintool.py
[..]
> + def version(self):
> + """Version handler
> +
> + Returns:
> + str: Version number
> + """
> + import re
> +
> + result = self.run_cmd_result('-V')
> + if not result:
> + return super().version()
Those two lines are dead / untested code. I'll drop them when applying.
> +
> + out = result.stdout.strip()
> + if not out:
> + out = result.stderr.strip()
> + if not out:
> + return super().version()
> +
> + m_version = re.search(self.version_regex, out)
> + return m_version.group(1) if m_version else out
> --
> 2.30.2
Regards,
Simon
More information about the U-Boot
mailing list