u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* [PATCH] test/py: Improve check for mksquashfs version
@ 2021-07-22 20:52 Marek Behún
  2021-07-23  3:07 ` Simon Glass
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Marek Behún @ 2021-07-22 20:52 UTC (permalink / raw)
  To: Simon Glass, Joao Marcos Costa, U-Boot Mailing List; +Cc: Marek Behún

Some builds of squashfs-tools append version string with "-git" or
similar. The float() conversion will fail in this case.

Improve the code to only convert to float() the string before the '-'
character.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
---
 test/py/tests/test_fs/test_squashfs/sqfs_common.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/py/tests/test_fs/test_squashfs/sqfs_common.py b/test/py/tests/test_fs/test_squashfs/sqfs_common.py
index 267c4b57d1..8b84c2cdca 100644
--- a/test/py/tests/test_fs/test_squashfs/sqfs_common.py
+++ b/test/py/tests/test_fs/test_squashfs/sqfs_common.py
@@ -146,7 +146,7 @@ def get_mksquashfs_version():
     out = subprocess.run(['mksquashfs -version'], shell=True, check=True,
                          capture_output=True, text=True)
     # 'out' is: mksquashfs version X (yyyy/mm/dd) ...
-    return float(out.stdout.split()[2])
+    return float(out.stdout.split()[2].split('-')[0])
 
 def check_mksquashfs_version():
     """ Checks if mksquashfs meets the required version. """
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] test/py: Improve check for mksquashfs version
  2021-07-22 20:52 [PATCH] test/py: Improve check for mksquashfs version Marek Behún
@ 2021-07-23  3:07 ` Simon Glass
  2021-07-23 13:00 ` João Marcos Costa
  2021-07-29 16:49 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Glass @ 2021-07-23  3:07 UTC (permalink / raw)
  To: Marek Behún; +Cc: Joao Marcos Costa, U-Boot Mailing List

On Thu, 22 Jul 2021 at 14:52, Marek Behún <marek.behun@nic.cz> wrote:
>
> Some builds of squashfs-tools append version string with "-git" or
> similar. The float() conversion will fail in this case.
>
> Improve the code to only convert to float() the string before the '-'
> character.
>
> Signed-off-by: Marek Behún <marek.behun@nic.cz>
> ---
>  test/py/tests/test_fs/test_squashfs/sqfs_common.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

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

Thanks, I hit that on rpi actually.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] test/py: Improve check for mksquashfs version
  2021-07-22 20:52 [PATCH] test/py: Improve check for mksquashfs version Marek Behún
  2021-07-23  3:07 ` Simon Glass
@ 2021-07-23 13:00 ` João Marcos Costa
  2021-07-29 16:49 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: João Marcos Costa @ 2021-07-23 13:00 UTC (permalink / raw)
  To: Marek Behún; +Cc: Simon Glass, U-Boot Mailing List

Em qui., 22 de jul. de 2021 às 17:52, Marek Behún <marek.behun@nic.cz> escreveu:
>
> Some builds of squashfs-tools append version string with "-git" or
> similar. The float() conversion will fail in this case.
>
> Improve the code to only convert to float() the string before the '-'
> character.
>
> Signed-off-by: Marek Behún <marek.behun@nic.cz>
> ---
>  test/py/tests/test_fs/test_squashfs/sqfs_common.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/test/py/tests/test_fs/test_squashfs/sqfs_common.py b/test/py/tests/test_fs/test_squashfs/sqfs_common.py
> index 267c4b57d1..8b84c2cdca 100644
> --- a/test/py/tests/test_fs/test_squashfs/sqfs_common.py
> +++ b/test/py/tests/test_fs/test_squashfs/sqfs_common.py
> @@ -146,7 +146,7 @@ def get_mksquashfs_version():
>      out = subprocess.run(['mksquashfs -version'], shell=True, check=True,
>                           capture_output=True, text=True)
>      # 'out' is: mksquashfs version X (yyyy/mm/dd) ...
> -    return float(out.stdout.split()[2])
> +    return float(out.stdout.split()[2].split('-')[0])
>
>  def check_mksquashfs_version():
>      """ Checks if mksquashfs meets the required version. """
> --
> 2.31.1
>

Reviewed-by: Joao Marcos Costa <jmcosta944@gmail.com>

Thanks!

-- 
Atenciosamente,
João Marcos Costa

www.linkedin.com/in/jmarcoscosta/
https://github.com/jmarcoscosta

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] test/py: Improve check for mksquashfs version
  2021-07-22 20:52 [PATCH] test/py: Improve check for mksquashfs version Marek Behún
  2021-07-23  3:07 ` Simon Glass
  2021-07-23 13:00 ` João Marcos Costa
@ 2021-07-29 16:49 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2021-07-29 16:49 UTC (permalink / raw)
  To: Marek Behún; +Cc: Simon Glass, Joao Marcos Costa, U-Boot Mailing List

[-- Attachment #1: Type: text/plain, Size: 492 bytes --]

On Thu, Jul 22, 2021 at 10:52:05PM +0200, Marek Behún wrote:

> Some builds of squashfs-tools append version string with "-git" or
> similar. The float() conversion will fail in this case.
> 
> Improve the code to only convert to float() the string before the '-'
> character.
> 
> Signed-off-by: Marek Behún <marek.behun@nic.cz>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Joao Marcos Costa <jmcosta944@gmail.com>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-07-29 16:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-22 20:52 [PATCH] test/py: Improve check for mksquashfs version Marek Behún
2021-07-23  3:07 ` Simon Glass
2021-07-23 13:00 ` João Marcos Costa
2021-07-29 16:49 ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).