[Rpm-maint] [rpm-software-management/rpm] Restore scriptlet arguments passed as numbers to Lua scriptlets (PR #1831)

Panu Matilainen notifications at github.com
Tue Nov 16 10:45:55 UTC 2021


Commit 717a3f7ecf0af7c453cd1bcb3f49b5ea4941817e changed Lua scriptlet
arguments from numbers to strings, and claimed that Lua will handle
this automatically so nobody will notice a thing. Not so, Lua only
converts automatically when doing so is unambiguous, such as doing
math. In comparison Lua cannot know which kind of comparison we want,
and rightly refuses to convert. Thus, the commit broke any Lua
scriptlets doing `if arg[2] > 1 then ... end` style comparisons.

As the whole rpmluav variable API is gone now, we can't just revert
the commit. Adding a preamble to the scriptlet to convert the args
to numbers may be hackish, but its a far lesser evil than bringing the
internal variable API back. Kudos to Michael Schroeder for the idea.

Fixes: #1790
You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/1831

-- Commit Summary --

  * Restore scriptlet arguments passed as numbers to Lua scriptlets

-- File Changes --

    M lib/rpmscript.c (11)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/1831.patch
https://github.com/rpm-software-management/rpm/pull/1831.diff

-- 
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/pull/1831
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20211116/19d92c79/attachment-0001.html>


More information about the Rpm-maint mailing list