Fix requires. Hopefully.

This commit is contained in:
Karolina Surma 2025-11-21 14:38:06 +01:00
commit c7907791fa

View file

@ -12,8 +12,7 @@
local version = _pythonprerel_version_cache[path]
if not version then
local buildroot = rpm.expand('%{buildroot}')
local ld_library_path = buildroot .. '/usr/lib64:' .. buildroot .. '/usr/lib'
local ld_library_path = rpm.expand('%{buildroot}%{_libdir}')
local cmd = 'LD_LIBRARY_PATH=' .. ld_library_path .. ' ' .. path .. [[ -Esc "import sys; sys.stdout.write('{0.major}.{0.minor}.{0.micro}~{0.releaselevel}{0.serial}'.format(sys.version_info))"]]
version = io.popen(cmd):read("*a")
-- Cache the version for future calls
@ -38,13 +37,11 @@
_pythonprerel_version_cache = {}
end
local buildroot = rpm.expand('%{buildroot}')
local python_path = buildroot .. '/usr/bin/python' .. pyver
local python_path = '/usr/bin/python' .. pyver
local version = _pythonprerel_version_cache[python_path]
if not version then
local ld_library_path = buildroot .. '/usr/lib64:' .. buildroot .. '/usr/lib'
local cmd = 'LD_LIBRARY_PATH=' .. ld_library_path .. ' ' .. python_path .. [[ -Esc "import sys; sys.stdout.write('{0.major}.{0.minor}.{0.micro}~{0.releaselevel}{0.serial}'.format(sys.version_info))"]]
local cmd = python_path .. [[ -Esc "import sys; sys.stdout.write('{0.major}.{0.minor}.{0.micro}~{0.releaselevel}{0.serial}'.format(sys.version_info))"]]
version = io.popen(cmd):read("*a")
-- Cache the version for future calls
_pythonprerel_version_cache[python_path] = version
@ -55,4 +52,4 @@
end
}
%__pythonprerel_path ^((/usr/lib(64)?/python[[:digit:]]+\\.[[:digit:]]+/.*\\.so)|(%{_bindir}/python[[:digit:]]+\\.[[:digit:]]+))$
%__pythonprerel_path ^((/usr/lib(64)?/python[[:digit:]]+\\.[[:digit:]]+/site-packages/.*\\.so)|(%{_bindir}/python[[:digit:]]+\\.[[:digit:]]+))$