[Rpm-maint] [rpm-software-management/rpm] [regression?] arg[2] to lua scriptlet became a string instead of number (#1790)
mikhailnov
notifications at github.com
Sat Oct 2 21:33:41 UTC 2021
The following scriptlet worked ok in rpm 4.15 and 4.16:
```
%post -p <lua>
if arg[2] >= 2 then
vr = posix.stat("/var/run")
<...>
```
But it stopped working in rpm 4.17:
```
lua script failed: [string "%post(filesystem-2.1.9-48.x86_64)"]:2: attempt to compare number with string
```
I am not an expert in lua, but `2` here seems to be an integer, not a string.
I can suspect commit https://github.com/rpm-software-management/rpm/commit/717a3f7ecf0af7c453cd1bcb3f49b5ea4941817e "Pass install scriptlet arguments to Lua as real local arguments", it states that "Lua will automatically convert numbers as necessary so this should not break anything", but seems that it broke something.
I "fixed" the problem by just removing that scriptlet because it is not needed any more (https://abf.io/import/filesystem/commit/5806ae4e0504314bdcd0417be94d4637d76d3eb1) but it looks like an unexpected breakage.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1790
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20211002/345d96f9/attachment.html>
More information about the Rpm-maint
mailing list