From 1d2d4ece70e33be811877663337ef0a6ea029858 Mon Sep 17 00:00:00 2001 From: Can Bulut Bayburt Date: Wed, 3 Jul 2024 16:36:35 +0200 Subject: [PATCH] Support more NEVRA types when importing module metadata --- python/spacewalk/satellite_tools/appstreams.py | 2 +- ...alk-backend.changes.cbbayburt.appstreams-reposync-8972 | 1 + .../unit/spacewalk/satellite_tools/test_appstreams.py | 8 ++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 python/spacewalk/spacewalk-backend.changes.cbbayburt.appstreams-reposync-8972 diff --git a/python/spacewalk/satellite_tools/appstreams.py b/python/spacewalk/satellite_tools/appstreams.py index 3e64390a33e1..e99cfd33f405 100644 --- a/python/spacewalk/satellite_tools/appstreams.py +++ b/python/spacewalk/satellite_tools/appstreams.py @@ -286,7 +286,7 @@ def _parse_rpm_name(nevra): pattern = re.compile( r"(?P[a-zA-Z0-9._+-]+)-" r"(?P\d+:)?" - r"(?P[a-zA-Z0-9._-]+)-" + r"(?P[a-zA-Z0-9._-~]+)-" r"(?P[a-zA-Z0-9._+-]+)\." r"(?P[a-zA-Z0-9._-]+)" ) diff --git a/python/spacewalk/spacewalk-backend.changes.cbbayburt.appstreams-reposync-8972 b/python/spacewalk/spacewalk-backend.changes.cbbayburt.appstreams-reposync-8972 new file mode 100644 index 000000000000..8fc1882c3b67 --- /dev/null +++ b/python/spacewalk/spacewalk-backend.changes.cbbayburt.appstreams-reposync-8972 @@ -0,0 +1 @@ +- Support more NEVRA types when importing module metadata diff --git a/python/test/unit/spacewalk/satellite_tools/test_appstreams.py b/python/test/unit/spacewalk/satellite_tools/test_appstreams.py index c2239c23b666..cdcb2a9566b0 100644 --- a/python/test/unit/spacewalk/satellite_tools/test_appstreams.py +++ b/python/test/unit/spacewalk/satellite_tools/test_appstreams.py @@ -178,6 +178,14 @@ def test_get_modules(importer): "396.module_el8.1.0+6019+b22674e1", "noarch", ), + ( + "php-pecl-gmagick-0:2.0.5~RC1-4.el8.remi.7.2.x86_64", + "php-pecl-gmagick", + "0", + "2.0.5~RC1", + "4.el8.remi.7.2", + "x86_64", + ), ], ) def test_parse_rpm_name(nevra_input, name, epoch, version, release, arch):