diff mbox series

[v3,6/7] binman: btool: futility: use Bintool.version

Message ID 20220901155143.1868735-6-foss+uboot@0leil.net
State Accepted
Commit 9c9678632765678e607a88f0ebe7f5260ad6fdaa
Delegated to: Simon Glass
Headers show
Series [v3,1/7] binman: bintool: move version check implementation into bintool class | expand

Commit Message

Quentin Schulz Sept. 1, 2022, 3:51 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 futility anymore.

Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

v3:
 - added Rb,

added in v2

 tools/binman/btool/futility.py | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

Comments

Simon Glass Sept. 7, 2022, 12:29 p.m. UTC | #1
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 futility anymore.

Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

v3:
 - added Rb,

added in v2

 tools/binman/btool/futility.py | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

Applied to u-boot-dm, thanks!
diff mbox series

Patch

diff --git a/tools/binman/btool/futility.py b/tools/binman/btool/futility.py
index 8d00966a9d..75a05c2ac6 100644
--- a/tools/binman/btool/futility.py
+++ b/tools/binman/btool/futility.py
@@ -69,7 +69,7 @@  class Bintoolfutility(bintool.Bintool):
         https://chromium.googlesource.com/chromiumos/platform/vboot/+/refs/heads/main/_vboot_reference/README
     """
     def __init__(self, name):
-        super().__init__(name, 'Chromium OS firmware utility')
+        super().__init__(name, 'Chromium OS firmware utility', r'^(.*)$', 'version')
 
     def gbb_create(self, fname, sizes):
         """Create a new Google Binary Block
@@ -165,14 +165,3 @@  class Bintoolfutility(bintool.Bintool):
         fname, tmpdir = self.fetch_from_drive(
             '1hdsInzsE4aJbmBeJ663kYgjOQyW1I-E0')
         return fname, tmpdir
-
-    def version(self):
-        """Version handler for futility
-
-        Returns:
-            str: Version string for futility
-        """
-        out = self.run_cmd('version').strip()
-        if not out:
-            return super().version()
-        return out