This removes an ugly hack that was used to get rid of: warning: Macro %1 defined but not used within scope I've noticed the %_pythonname_obsoletes generator does not expand %1 on non-RHELs and yet the warning is not shown. When debugging the missing warning, I've noticed it is never shown at all. According to RPM upstream, the warning was an undesired artifact: https://github.com/rpm-software-management/rpm/discussions/2501 It was purposefully removed starting with RPM 4.17.
37 lines
1.5 KiB
Plaintext
37 lines
1.5 KiB
Plaintext
%__pythonname_provides() %{lua:
|
|
local python = require 'fedora.srpm.python'
|
|
local name = rpm.expand('%{name}')
|
|
local evr = rpm.expand('%{?epoch:%{epoch}:}%{version}-%{release}')
|
|
local provides = python.python_altprovides_once(name, evr)
|
|
-- provides is either an array/table or nil
|
|
-- nil means the function was already called with the same arguments:
|
|
-- either with another file in %1 or manually via %py_provides
|
|
if provides then
|
|
for i, provide in ipairs(provides) do
|
|
print(provide .. ' ')
|
|
end
|
|
end
|
|
}
|
|
|
|
%__pythonname_obsoletes() %{?rhel:%{lua:
|
|
-- On CentOS/RHEL we automatically generate Obsoletes tags in the form:
|
|
-- package python3-foo -> Obsoletes: python3.XY-foo
|
|
-- This provides a clean upgrade path between major versions of CentOS/RHEL.
|
|
-- In Fedora this is not needed as we don't ship ecosystem packages
|
|
-- for alternative Python interpreters.
|
|
local python = require 'fedora.srpm.python'
|
|
local name = rpm.expand('%{name}')
|
|
local evr = rpm.expand('%{?epoch:%{epoch}:}%{version}-%{release}')
|
|
local obsoletes = python.python_altobsoletes_once(name, evr)
|
|
-- obsoletes is either an array/table or nil
|
|
-- nil means the function was already called with the same arguments:
|
|
-- either with another file in %1 or manually via %py_provides
|
|
if obsoletes then
|
|
for i, obsolete in ipairs(obsoletes) do
|
|
print(obsolete .. ' ')
|
|
end
|
|
end
|
|
}}
|
|
|
|
%__pythonname_path ^/
|