[elbe-devel] [EXTERNAL MAIL]Re: [PATCH] fix package list validation error when using wildcards in package version

Buehler, Matthias Matthias.Buehler at trumpf.com
Wed Jan 13 14:34:32 CET 2021


Hi Bastian,

here is my patch with singned-off:

From b3c389d67e8a77c4512f3b26246afb826e38149d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Matthias=20B=C3=BChler?= <matthias.buehler at trumpf.com>
Date: Fri, 6 Nov 2020 09:03:11 +0100
Subject: [PATCH] fix package list validation error when using wildcards in
 package version
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Matthias Bühler <matthias.buehler at trumpf.com>
---
 elbepack/dump.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/elbepack/dump.py b/elbepack/dump.py
index edc6637f..ec5e8fbf 100644
--- a/elbepack/dump.py
+++ b/elbepack/dump.py
@@ -6,6 +6,7 @@
 # SPDX-License-Identifier: GPL-3.0-or-later
 
 import logging
+import re
 
 from datetime import datetime
 
@@ -106,7 +107,7 @@ def check_full_pkgs(pkgs, fullpkgs, cache):
 
             ver = p.et.get('version')
             pkg = cache.get_pkg(nomulti_name)
-            if ver and (pkg.installed_version != ver):
+            if ver and (not re.match(ver, pkg.installed_version)):
                 validation.error("Package '%s' version '%s' does not match installed version %s",
                                  name, ver, pkg.installed_version)
                 errors += 1
@@ -143,7 +144,7 @@ def check_full_pkgs(pkgs, fullpkgs, cache):
 
         pkg = cache.get_pkg(name)
 
-        if pkg.installed_version != ver:
+        if not re.match(ver, pkg.installed_version):
             validation.error("Package '%s' version %s does not match installed version %s",
                              name, ver, pkg.installed_version)
             errors += 1
-- 
2.11.0

Regards 
Matthias

-----Ursprüngliche Nachricht-----
Von: Bastian Germann <bage at linutronix.de> 
Gesendet: Mittwoch, 13. Januar 2021 14:20
An: Buehler, Matthias <Matthias.Buehler at trumpf.com>; elbe-devel at linutronix.de
Betreff: [EXTERNAL MAIL]Re: [elbe-devel] [PATCH] fix package list validation error when using wildcards in package version

Am 06.11.20 um 09:09 schrieb Buehler, Matthias:
> Fix issue #276 "package list validation error when using wildcards in package version".
> Instead of comparing version strings use regex to match versions.
> 
>  From b3c389d67e8a77c4512f3b26246afb826e38149d Mon Sep 17 00:00:00 
> 2001
> From: =?UTF-8?q?Matthias=20B=C3=BChler?= <matthias.buehler at trumpf.com>
> Date: Fri, 6 Nov 2020 09:03:11 +0100
> Subject: [PATCH] fix package list validation error when using wildcards in
>   package version
> 

Hi Matthias,

Please resend your `git format-patch` formatted patch with a Signed-off-by line that certifies the origin of the patch. With this you say that for this elbe contribution you agree to https://developercertificate.org/

Sorry for the late answer.

Regards,
Bastian

> ---
>   elbepack/dump.py | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/elbepack/dump.py b/elbepack/dump.py index 
> edc6637f6..ec5e8fbfb 100644
> --- a/elbepack/dump.py
> +++ b/elbepack/dump.py
> @@ -6,6 +6,7 @@
>   # SPDX-License-Identifier: GPL-3.0-or-later
> 
>   import logging
> +import re
> 
>   from datetime import datetime
> 
> @@ -106,7 +107,7 @@ def check_full_pkgs(pkgs, fullpkgs, cache):
> 
>               ver = p.et.get('version')
>               pkg = cache.get_pkg(nomulti_name)
> -            if ver and (pkg.installed_version != ver):
> +            if ver and (not re.match(ver, pkg.installed_version)):
>                   validation.error("Package '%s' version '%s' does not match installed version %s",
>                                    name, ver, pkg.installed_version)
>                   errors += 1
> @@ -143,7 +144,7 @@ def check_full_pkgs(pkgs, fullpkgs, cache):
> 
>           pkg = cache.get_pkg(name)
> 
> -        if pkg.installed_version != ver:
> +        if not re.match(ver, pkg.installed_version):
>               validation.error("Package '%s' version %s does not match installed version %s",
>                                name, ver, pkg.installed_version)
>               errors += 1
> --
> 2.11.0
> 
> 
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel
> 


More information about the elbe-devel mailing list