Remove fnmatch from nodeps gather method

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2020-03-12 09:47:00 +01:00
parent fb7f7396be
commit a32bf4046f

View File

@ -15,7 +15,7 @@
import os import os
from pprint import pformat from pprint import pformat
from fnmatch import fnmatch import re
import six import six
import pungi.arch import pungi.arch
@ -75,8 +75,11 @@ class GatherMethodNodeps(pungi.phases.gather.method.GatherMethodBase):
if not pkg_is_rpm(pkg): if not pkg_is_rpm(pkg):
continue continue
for gathered_pkg, pkg_arch in packages: for gathered_pkg, pkg_arch in packages:
if isinstance(gathered_pkg, six.string_types) and not fnmatch( if isinstance(gathered_pkg, six.string_types) and not re.match(
pkg.name, gathered_pkg gathered_pkg.replace(".", "\\.")
.replace("+", "\\+")
.replace("*", ".*"),
pkg.name,
): ):
continue continue
elif ( elif (