%py_provides: Do not generate Obsoletes for names containing parentheses
This mechanism is already implemented in the old %python_provide macro.
This commit is contained in:
parent
99e7d8694c
commit
e250f28d09
@ -210,9 +210,14 @@
|
||||
-- In Fedora this is not needed as we don't ship ecosystem packages
|
||||
-- for alternative Python interpreters.
|
||||
if rhel ~= '' then
|
||||
local obsoletes = python.python_altobsoletes(name, evr)
|
||||
for i, obsolete in ipairs(obsoletes) do
|
||||
print('Obsoletes: ' .. obsolete .. '\\n')
|
||||
-- Create Obsoletes only if the name does not end in a parenthesis,
|
||||
-- as Obsoletes can't include parentheses.
|
||||
-- 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
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ elseif posix.stat('macros.python-srpm') then
|
||||
end
|
||||
}
|
||||
Version: %{__default_python3_version}
|
||||
Release: 16%{?dist}
|
||||
Release: 17%{?dist}
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
@ -151,6 +151,9 @@ install -m 755 brp-* %{buildroot}%{_rpmconfigdir}/redhat/
|
||||
|
||||
|
||||
%changelog
|
||||
* Tue Feb 08 2022 Tomas Orsava <torsava@redhat.com> - 3.10-17
|
||||
- %%py_provides: Do not generate Obsoletes for names containing parentheses
|
||||
|
||||
* Mon Jan 31 2022 Miro Hrončok <mhroncok@redhat.com> - 3.10-16
|
||||
- Explicitly opt-out from Python name-based provides and obsoletes generators
|
||||
|
||||
|
@ -195,6 +195,16 @@ def test_py_provides_python3(rhel):
|
||||
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])
|
||||
def test_py_provides_python3_epoched(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