From 6bf18de563be003de2534e5b10e84959a8ec5616 Mon Sep 17 00:00:00 2001 From: DistroBaker Date: Thu, 11 Mar 2021 20:31:16 +0000 Subject: [PATCH] Merged update from upstream sources This is an automated DistroBaker update from upstream sources. If you do not know what this is about or would like to opt out, contact the OSCI team. Source: https://src.fedoraproject.org/rpms/python-rpm-macros.git#a6382f5b5a6536d01477b71cf5a378c30c828783 --- macros.python-srpm | 2 +- python-rpm-macros.spec | 5 ++++- tests/test_evals.py | 15 +++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/macros.python-srpm b/macros.python-srpm index f19ee45..c5935f9 100644 --- a/macros.python-srpm +++ b/macros.python-srpm @@ -198,7 +198,7 @@ rpm.expand('%{error:%%%0 requires at least one argument with "extras" name}') end local requires = 'Requires: ' .. value_n .. ' = %{?epoch:%{epoch}:}%{version}-%{release}' - for extras in args:gmatch('%w+') do + for extras in args:gmatch('%S+') do local rpmname = value_n .. '+' .. extras local pkgdef = '%package -n ' .. rpmname local summary = 'Summary: Metapackage for ' .. value_n .. ': ' .. extras .. ' extras' diff --git a/python-rpm-macros.spec b/python-rpm-macros.spec index 0c4eb81..27d568e 100644 --- a/python-rpm-macros.spec +++ b/python-rpm-macros.spec @@ -1,6 +1,6 @@ Name: python-rpm-macros Version: 3.9 -Release: 34%{?dist} +Release: 35%{?dist} Summary: The common Python RPM macros # macros and lua: MIT, compileall2.py: PSFv2 @@ -90,6 +90,9 @@ install -m 644 compileall2.py %{buildroot}%{_rpmconfigdir}/redhat/ %changelog +* Sat Feb 20 2021 Miro Hrončok - 3.9-35 +- Fix %%python_extras_subpkg with underscores in extras names + * Mon Feb 08 2021 Miro Hrončok - 3.9-34 - Remove python2-rpm-macros - https://fedoraproject.org/wiki/Changes/Disable_Python_2_Dist_RPM_Generators_and_Freeze_Python_2_Macros diff --git a/tests/test_evals.py b/tests/test_evals.py index 0c802c1..6904caa 100644 --- a/tests/test_evals.py +++ b/tests/test_evals.py @@ -409,6 +409,21 @@ def test_python_extras_subpkg_F(): assert lines == expected +def test_python_extras_subpkg_underscores(): + lines = rpm_eval('%python_extras_subpkg -n python3-webscrapbook -F adhoc_ssl', + version='0.33.3', release='1.fc33') + expected = textwrap.dedent(f""" + %package -n python3-webscrapbook+adhoc_ssl + Summary: Metapackage for python3-webscrapbook: adhoc_ssl extras + Requires: python3-webscrapbook = 0.33.3-1.fc33 + %description -n python3-webscrapbook+adhoc_ssl + This is a metapackage bringing in adhoc_ssl extras requires for + python3-webscrapbook. + It contains no code, just makes sure the dependencies are installed. + """).lstrip().splitlines() + assert lines == expected + + @pytest.mark.parametrize('basename_len', [1, 10, 30, 45, 78]) @pytest.mark.parametrize('extra_len', [1, 13, 28, 52, 78]) def test_python_extras_subpkg_description_wrapping(basename_len, extra_len):