python-rpm-generators/pythonname.attr
Troy Dawson e25505c276 RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/python-rpm-generators#bfb7f70b994d667b703a6b16c2b35d5056572800
2020-10-14 20:10:06 -07:00

20 lines
861 B
Plaintext

%__pythonname_provides() %{lua:
local python = require 'fedora.srpm.python'
-- this macro is called for each file in a package, the path being in %1
-- but we don't need to know the path, so we would get for each file: Macro %1 defined but not used within scope
-- in here, we expand %name conditionally on %1 to suppress the warning
local name = rpm.expand('%{?1:%{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_provide
if provides then
for i, provide in ipairs(provides) do
print(provide .. ' ')
end
end
}
%__pythonname_path ^/