Dne 08. 04. 22 v 10:56 Panu Matilainen napsal(a):
On 4/7/22 20:14, Zbigniew Jędrzejewski-Szmek wrote:
> On Thu, Apr 07, 2022 at 12:13:42PM -0400, Ben Cotton wrote:
>>
https://fedoraproject.org/wiki/Changes/RPM-4.18
>
>> * New interactive shell for working with macros (`rpmspec --shell`)
>> and embedded Lua (`rpmlua`)
>
> That sounds cool. Can this be used to do standalone interpretation
> of <lua> scriptlets? I'm wondering about the issue that we have with
> rpm-ostree, which only supports bash scriptlets, so we end up rewriting
> <lua> scriptlets and filetriggers to bash for the sake of rpm-ostree.
Well, it's a Lua interpeter, and so you can use it to execute Lua
scripts from a file using the rpm embedded Lua interpreter so you'll
have the same extensions loaded. It's not the same as getting executed
from inside rpm transaction though because all sorts of context is
missing, and this is not the intended use-case of the thing. That
said, assuming the caller sets up scriptlet arguments and other state
as per expectations, I don't see why simple scriptlets would not work.
File triggers will not.
I was just thinking about something similar yesterday in the context of
rhbz#2073170. The issue is that there is redhat-rpm-config macro using
Lua string patterns. So if there was a way to reuse the patterns also
from e.g. the build section, that would be useful.
Vít