Hi Stefan, On Fri, 19 Aug 2022 at 08:26, Stefan Herbrechtsmeier <stefan.herbrechtsmeier-...@weidmueller.com> wrote: > > From: Stefan Herbrechtsmeier <stefan.herbrechtsme...@weidmueller.com> > > Add a bintools base class for packers which compression / decompression > entry contents. > > Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsme...@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 <s...@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