]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
binman: btool: lz4: use Bintool.version
authorQuentin Schulz <quentin.schulz@theobroma-systems.com>
Thu, 1 Sep 2022 15:51:38 +0000 (17:51 +0200)
committerSimon Glass <sjg@chromium.org>
Thu, 1 Sep 2022 17:36:36 +0000 (11:36 -0600)
Bintool.version already contains everything required to get the version
out of lz4 binary so let's not override it with its own implementation.

Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
tools/binman/btool/lz4.py

index f09c5c8904bb296fdb503fb6b79c7427a3ce707a..dc9e37921a6247d68bb2413d570e9f4ca12c4126 100644 (file)
@@ -76,7 +76,7 @@ class Bintoollz4(bintool.Bintool):
         man lz4
     """
     def __init__(self, name):
-        super().__init__(name, 'lz4 compression')
+        super().__init__(name, 'lz4 compression', r'.* (v[0-9.]*),.*')
 
     def compress(self, indata):
         """Compress data with lz4
@@ -126,15 +126,3 @@ class Bintoollz4(bintool.Bintool):
         if method != bintool.FETCH_BIN:
             return None
         return self.apt_install('lz4')
-
-    def version(self):
-        """Version handler
-
-        Returns:
-            str: Version number of lz4
-        """
-        out = self.run_cmd('-V').strip()
-        if not out:
-            return super().version()
-        m_version = re.match(r'.* (v[0-9.]*),.*', out)
-        return m_version.group(1) if m_version else out