diff mbox series

[v2,5/7] binman: btool: fiptool: use Bintool.version

Message ID 20220831173936.150114-5-foss+uboot@0leil.net
State Superseded
Delegated to: Simon Glass
Headers show
Series [v2,1/7] binman: bintool: move version check implementation into bintool class | expand

Commit Message

Quentin Schulz Aug. 31, 2022, 5:39 p.m. UTC
From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

Bintool.version can now be passed the binary argument to return the
version text, so there's no need to override it in fiptool anymore.

Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---

added in v2

 tools/binman/btool/fiptool.py | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

Comments

Simon Glass Sept. 1, 2022, 2:27 a.m. UTC | #1
On Wed, 31 Aug 2022 at 11:40, Quentin Schulz <foss+uboot@0leil.net> wrote:
>
> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
>
> Bintool.version can now be passed the binary argument to return the
> version text, so there's no need to override it in fiptool anymore.
>
> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> ---
>
> added in v2
>
>  tools/binman/btool/fiptool.py | 11 +----------
>  1 file changed, 1 insertion(+), 10 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/tools/binman/btool/fiptool.py b/tools/binman/btool/fiptool.py
index c6d71cebc2..c80f8275c4 100644
--- a/tools/binman/btool/fiptool.py
+++ b/tools/binman/btool/fiptool.py
@@ -49,7 +49,7 @@  class Bintoolfiptool(bintool.Bintool):
         https://trustedfirmware-a.readthedocs.io/en/latest/getting_started/tools-build.html?highlight=fiptool#building-and-using-the-fip-tool
     """
     def __init__(self, name):
-        super().__init__(name, 'Manipulate ATF FIP files')
+        super().__init__(name, 'Manipulate ATF FIP files', r'^(.*)$', 'version')
 
     def info(self, fname):
         """Get info on a FIP image
@@ -112,12 +112,3 @@  class Bintoolfiptool(bintool.Bintool):
             'fiptool',
             'tools/fiptool/fiptool')
         return result
-
-    def version(self):
-        """Version handler for fiptool
-
-        Returns:
-            str: Version number of fiptool
-        """
-        out = self.run_cmd('version').strip()
-        return out or super().version()