Blame SOURCES/pythonname.attr

5cdac4
%__pythonname_provides() %{lua:
5cdac4
    local python = require 'fedora.srpm.python'
5cdac4
    -- this macro is called for each file in a package, the path being in %1
5cdac4
    -- but we don't need to know the path, so we would get for each file: Macro %1 defined but not used within scope
5cdac4
    -- in here, we expand %name conditionally on %1 to suppress the warning
5cdac4
    local name = rpm.expand('%{?1:%{name}}')
5cdac4
    local evr = rpm.expand('%{?epoch:%{epoch}:}%{version}-%{release}')
5cdac4
    local provides = python.python_altprovides_once(name, evr)
5cdac4
    -- provides is either an array/table or nil
5cdac4
    -- nil means the function was already called with the same arguments:
a93364
    --   either with another file in %1 or manually via %py_provides
5cdac4
    if provides then
5cdac4
      for i, provide in ipairs(provides) do
5cdac4
          print(provide .. ' ')
5cdac4
        end
5cdac4
    end
5cdac4
}
5cdac4
a93364
%__pythonname_obsoletes() %{?rhel:%{lua:
a93364
    -- On CentOS/RHEL we automatically generate Obsoletes tags in the form:
a93364
    --   package python3-foo -> Obsoletes: python3.XY-foo
a93364
    -- This provides a clean upgrade path between major versions of CentOS/RHEL.
a93364
    -- In Fedora this is not needed as we don't ship ecosystem packages
a93364
    -- for alternative Python interpreters.
a93364
    local python = require 'fedora.srpm.python'
a93364
    -- this macro is called for each file in a package, the path being in %1
a93364
    -- but we don't need to know the path, so we would get for each file: Macro %1 defined but not used within scope
a93364
    -- in here, we expand %name conditionally on %1 to suppress the warning
a93364
    local name = rpm.expand('%{?1:%{name}}')
a93364
    local evr = rpm.expand('%{?epoch:%{epoch}:}%{version}-%{release}')
a93364
    local obsoletes = python.python_altobsoletes_once(name, evr)
a93364
    -- obsoletes is either an array/table or nil
a93364
    -- nil means the function was already called with the same arguments:
a93364
    --   either with another file in %1 or manually via %py_provides
a93364
    if obsoletes then
a93364
      for i, obsolete in ipairs(obsoletes) do
a93364
          print(obsolete .. ' ')
a93364
        end
a93364
    end
a93364
}}
a93364
5cdac4
%__pythonname_path ^/