diff mbox series

[SWUGenerator] fix: zstd-compressed images

Message ID 20230327093149.449517-1-michael.adler@siemens.com
State Accepted
Headers show
Series [SWUGenerator] fix: zstd-compressed images | expand

Commit Message

Michael Adler March 27, 2023, 9:31 a.m. UTC
It's currently not possible to generate zstd-compressed images because
as soon as the "compressed" attribute is defined, the Python code
overrides the value with "zlib".

Signed-off-by: Michael Adler <michael.adler@siemens.com>
---
 swugenerator/generator.py | 2 --
 1 file changed, 2 deletions(-)

Comments

Stefano Babic March 27, 2023, 10:15 a.m. UTC | #1
On 27.03.23 11:31, Michael Adler wrote:
> It's currently not possible to generate zstd-compressed images because
> as soon as the "compressed" attribute is defined, the Python code
> overrides the value with "zlib".
> 
> Signed-off-by: Michael Adler <michael.adler@siemens.com>
> ---
>   swugenerator/generator.py | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/swugenerator/generator.py b/swugenerator/generator.py
> index eaa3e6d..8d51557 100644
> --- a/swugenerator/generator.py
> +++ b/swugenerator/generator.py
> @@ -83,8 +83,6 @@ class SWUGenerator:
>   
>               if "compressed" in entry and not self.nocompress:
>                   cmp = entry["compressed"]
> -                if cmp:
> -                    cmp = "zlib"

This is surely something I left when I tested, and I forced it for some 
unknown reason. And of course, it is completely wrong, thanks for having 
found it.

>                   if cmp not in ("zlib", "zstd"):
>                       logging.critical("Wrong compression algorithm: %s", cmp)
>                       sys.exit(1)

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/swugenerator/generator.py b/swugenerator/generator.py
index eaa3e6d..8d51557 100644
--- a/swugenerator/generator.py
+++ b/swugenerator/generator.py
@@ -83,8 +83,6 @@  class SWUGenerator:
 
             if "compressed" in entry and not self.nocompress:
                 cmp = entry["compressed"]
-                if cmp:
-                    cmp = "zlib"
                 if cmp not in ("zlib", "zstd"):
                     logging.critical("Wrong compression algorithm: %s", cmp)
                     sys.exit(1)