Fix %python_provide when fed python3.10-foo to obsolete python-foo instead of python--foo
This has unlikely broken anything in practice, no packages in Fedora use %python_provide with major.minor-version-prefixed names. Related: rhbz#1950291
This commit is contained in:
parent
4f73bb9538
commit
9235955bb3
@ -74,6 +74,7 @@
|
||||
local package = rpm.expand("%{?1}")
|
||||
local vr = rpm.expand("%{?epoch:%{epoch}:}%{version}-%{release}")
|
||||
local provides = python.python_altprovides(package, vr)
|
||||
local default_python3_pkgversion = rpm.expand("%{__default_python3_pkgversion}")
|
||||
if (string.starts(package, "python3-")) then
|
||||
for i, provide in ipairs(provides) do
|
||||
print("\\nProvides: " .. provide)
|
||||
@ -84,14 +85,14 @@
|
||||
print(string.sub(package,9,string.len(package)))
|
||||
print(" < " .. vr)
|
||||
end
|
||||
elseif (string.starts(package, "python" .. rpm.expand("%{__default_python3_pkgversion}") .. "-")) then
|
||||
elseif (string.starts(package, "python" .. default_python3_pkgversion .. "-")) then
|
||||
for i, provide in ipairs(provides) do
|
||||
print("\\nProvides: " .. provide)
|
||||
end
|
||||
--Obsoleting the previous default python package (if it doesn't have isa)
|
||||
if (string.sub(package, "-1") ~= ")") then
|
||||
print("\\nObsoletes: python-")
|
||||
print(string.sub(package,11,string.len(package)))
|
||||
print(string.sub(package,8+string.len(default_python3_pkgversion),string.len(package)))
|
||||
print(" < " .. vr)
|
||||
end
|
||||
elseif (string.starts(package, "python")) then
|
||||
|
@ -1,6 +1,6 @@
|
||||
Name: python-rpm-macros
|
||||
Version: 3.9
|
||||
Release: 38%{?dist}
|
||||
Release: 39%{?dist}
|
||||
Summary: The common Python RPM macros
|
||||
URL: https://src.fedoraproject.org/rpms/python-rpm-macros/
|
||||
|
||||
@ -96,6 +96,9 @@ install -m 644 compileall2.py %{buildroot}%{_rpmconfigdir}/redhat/
|
||||
|
||||
|
||||
%changelog
|
||||
* Tue Jun 15 2021 Miro Hrončok <mhroncok@redhat.com> - 3.9-39
|
||||
- Fix %%python_provide when fed python3.10-foo to obsolete python-foo instead of python--foo
|
||||
|
||||
* Tue Apr 27 2021 Miro Hrončok <mhroncok@redhat.com> - 3.9-38
|
||||
- Escape %% symbols in macro files comments
|
||||
- Fixes: rhbz#1953910
|
||||
|
Loading…
Reference in New Issue
Block a user