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

Bastian Germann bage at linutronix.de
Wed Jan 13 14:20:05 CET 2021


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