From a32bf4046f9c1b6af72ff1f9d0b3592d9e7016e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Thu, 12 Mar 2020 09:47:00 +0100 Subject: [PATCH] Remove fnmatch from nodeps gather method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lubomír Sedlář --- pungi/phases/gather/methods/method_nodeps.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pungi/phases/gather/methods/method_nodeps.py b/pungi/phases/gather/methods/method_nodeps.py index 931add36..24517d39 100644 --- a/pungi/phases/gather/methods/method_nodeps.py +++ b/pungi/phases/gather/methods/method_nodeps.py @@ -15,7 +15,7 @@ import os from pprint import pformat -from fnmatch import fnmatch +import re import six import pungi.arch @@ -75,8 +75,11 @@ class GatherMethodNodeps(pungi.phases.gather.method.GatherMethodBase): if not pkg_is_rpm(pkg): continue for gathered_pkg, pkg_arch in packages: - if isinstance(gathered_pkg, six.string_types) and not fnmatch( - pkg.name, gathered_pkg + if isinstance(gathered_pkg, six.string_types) and not re.match( + gathered_pkg.replace(".", "\\.") + .replace("+", "\\+") + .replace("*", ".*"), + pkg.name, ): continue elif (