Fix %python_extras_subpkg with underscores in extras names
Fixes https://lists.fedoraproject.org/archives/list/packaging@lists.fedoraproject.org/thread/FI6J7JNKIOYGBYIN5UJVWYG24UIIES2U/
This commit is contained in:
parent
230ce7f061
commit
c79a12d20a
@ -198,7 +198,7 @@
|
|||||||
rpm.expand('%{error:%%%0 requires at least one argument with "extras" name}')
|
rpm.expand('%{error:%%%0 requires at least one argument with "extras" name}')
|
||||||
end
|
end
|
||||||
local requires = 'Requires: ' .. value_n .. ' = %{?epoch:%{epoch}:}%{version}-%{release}'
|
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 rpmname = value_n .. '+' .. extras
|
||||||
local pkgdef = '%package -n ' .. rpmname
|
local pkgdef = '%package -n ' .. rpmname
|
||||||
local summary = 'Summary: Metapackage for ' .. value_n .. ': ' .. extras .. ' extras'
|
local summary = 'Summary: Metapackage for ' .. value_n .. ': ' .. extras .. ' extras'
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Name: python-rpm-macros
|
Name: python-rpm-macros
|
||||||
Version: 3.9
|
Version: 3.9
|
||||||
Release: 13%{?dist}
|
Release: 14%{?dist}
|
||||||
Summary: The common Python RPM macros
|
Summary: The common Python RPM macros
|
||||||
|
|
||||||
# macros and lua: MIT, compileall2.py: PSFv2
|
# macros and lua: MIT, compileall2.py: PSFv2
|
||||||
@ -107,6 +107,9 @@ install -m 644 compileall2.py %{buildroot}%{_rpmconfigdir}/redhat/
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Sat Feb 20 2021 Miro Hrončok <mhroncok@redhat.com> - 3.9-14
|
||||||
|
- Fix %%python_extras_subpkg with underscores in extras names
|
||||||
|
|
||||||
* Fri Feb 05 2021 Miro Hrončok <mhroncok@redhat.com> - 3.9-13
|
* Fri Feb 05 2021 Miro Hrončok <mhroncok@redhat.com> - 3.9-13
|
||||||
- Automatically word-wrap the description of extras subpackages
|
- Automatically word-wrap the description of extras subpackages
|
||||||
- Fixes: rhbz#1922442
|
- Fixes: rhbz#1922442
|
||||||
|
@ -409,6 +409,21 @@ def test_python_extras_subpkg_F():
|
|||||||
assert lines == expected
|
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('basename_len', [1, 10, 30, 45, 78])
|
||||||
@pytest.mark.parametrize('extra_len', [1, 13, 28, 52, 78])
|
@pytest.mark.parametrize('extra_len', [1, 13, 28, 52, 78])
|
||||||
def test_python_extras_subpkg_description_wrapping(basename_len, extra_len):
|
def test_python_extras_subpkg_description_wrapping(basename_len, extra_len):
|
||||||
|
Loading…
Reference in New Issue
Block a user