%py_provides: Do not generate Obsoletes for names containing parentheses
This mechanism is already implemented in the old %python_provide macro. Related: rhbz#1990421
This commit is contained in:
parent
a30059967b
commit
85209d6c46
@ -182,9 +182,14 @@
|
|||||||
-- In Fedora this is not needed as we don't ship ecosystem packages
|
-- In Fedora this is not needed as we don't ship ecosystem packages
|
||||||
-- for alternative Python interpreters.
|
-- for alternative Python interpreters.
|
||||||
if rhel ~= '' then
|
if rhel ~= '' then
|
||||||
local obsoletes = python.python_altobsoletes(name, evr)
|
-- Create Obsoletes only if the name does not end in a parenthesis,
|
||||||
for i, obsolete in ipairs(obsoletes) do
|
-- as Obsoletes can't include parentheses.
|
||||||
print('Obsoletes: ' .. obsolete .. '\\n')
|
-- This most commonly happens when the name contains an isa.
|
||||||
|
if (string.sub(name, "-1") ~= ")") then
|
||||||
|
local obsoletes = python.python_altobsoletes(name, evr)
|
||||||
|
for i, obsolete in ipairs(obsoletes) do
|
||||||
|
print('Obsoletes: ' .. obsolete .. '\\n')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Name: python-rpm-macros
|
Name: python-rpm-macros
|
||||||
Version: 3.9
|
Version: 3.9
|
||||||
Release: 51%{?dist}
|
Release: 52%{?dist}
|
||||||
Summary: The common Python RPM macros
|
Summary: The common Python RPM macros
|
||||||
URL: https://src.fedoraproject.org/rpms/python-rpm-macros/
|
URL: https://src.fedoraproject.org/rpms/python-rpm-macros/
|
||||||
|
|
||||||
@ -116,6 +116,10 @@ install -m 644 import_all_modules.py %{buildroot}%{_rpmconfigdir}/redhat/
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Feb 08 2022 Tomas Orsava <torsava@redhat.com> - 3.9-52
|
||||||
|
- %%py_provides: Do not generate Obsoletes for names containing parentheses
|
||||||
|
- Related: rhbz#1990421
|
||||||
|
|
||||||
* Tue Feb 08 2022 Tomas Orsava <torsava@redhat.com> - 3.9-51
|
* Tue Feb 08 2022 Tomas Orsava <torsava@redhat.com> - 3.9-51
|
||||||
- Add Obsoletes tags with the python39- prefix for smoother upgrade from RHEL8
|
- Add Obsoletes tags with the python39- prefix for smoother upgrade from RHEL8
|
||||||
- Related: rhbz#1990421
|
- Related: rhbz#1990421
|
||||||
|
@ -195,6 +195,16 @@ def test_py_provides_python3(rhel):
|
|||||||
assert len(lines) == 3
|
assert len(lines) == 3
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize('rhel', [None, 9])
|
||||||
|
def test_py_provides_python3_with_isa(rhel):
|
||||||
|
lines = rpm_eval('%py_provides python3-foo(x86_64)', version='6', release='1.fc66', rhel=rhel)
|
||||||
|
assert 'Provides: python3-foo(x86_64) = 6-1.fc66' in lines
|
||||||
|
assert 'Provides: python-foo(x86_64) = 6-1.fc66' in lines
|
||||||
|
assert f'Provides: python{X_Y}-foo(x86_64) = 6-1.fc66' in lines
|
||||||
|
assert f'Obsoletes: python{X_Y}-foo(x86_64) < 6-1.fc66' not in lines
|
||||||
|
assert len(lines) == 3
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize('rhel', [None, 13])
|
@pytest.mark.parametrize('rhel', [None, 13])
|
||||||
def test_py_provides_python3_epoched(rhel):
|
def test_py_provides_python3_epoched(rhel):
|
||||||
lines = rpm_eval('%py_provides python3-foo', epoch='1', version='6', release='1.fc66', rhel=rhel)
|
lines = rpm_eval('%py_provides python3-foo', epoch='1', version='6', release='1.fc66', rhel=rhel)
|
||||||
|
Loading…
Reference in New Issue
Block a user