kmod.attr: optimization: do not call strip_compress_sfx() twice

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
This commit is contained in:
Denys Vlasenko 2023-05-04 12:43:01 +02:00
parent 491a3411df
commit 5df3d6d58b

View File

@ -15,16 +15,18 @@
for l in io.lines(fn) do
local builtin_mod = basename(l)
printdep(builtin_mod)
if strip_compress_sfx(builtin_mod) ~= builtin_mod then
printdep(strip_compress_sfx(builtin_mod))
local nocompr = strip_compress_sfx(builtin_mod)
if nocompr ~= builtin_mod then
printdep(nocompr)
end
end
else
local mod = string.match(bn, "%g+%.ko")
if mod then
printdep(mod)
if strip_compress_sfx(mod) ~= mod then
printdep(strip_compress_sfx(mod))
local nocompr = strip_compress_sfx(mod)
if nocompr ~= mod then
printdep(nocompr)
end
end
end