Re: [Rpm-maint] [rpm-software-management/rpm] Add support for passing real local arguments to Lua scriptlets (#1383)

2020-10-09 Thread Panu Matilainen
Merged #1383 into master. -- 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/1383#event-3859368672___ Rpm-maint mailing list Rpm-mai

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for passing real local arguments to Lua scriptlets (#1383)

2020-10-09 Thread Miro HronĨok
The provided example looks excellent, thank you! -- 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/1383#issuecomment-706087800___ R

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for passing real local arguments to Lua scriptlets (#1383)

2020-10-09 Thread Panu Matilainen
Thanks for the review. -- 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/1383#issuecomment-706086342___ Rpm-maint mailing list Rpm-

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for passing real local arguments to Lua scriptlets (#1383)

2020-10-08 Thread Michael Schroeder
@mlschroe commented on this pull request. > +lua_newtable(L); +if (opts) { + int c, argc = argvCount(args); + +/* glibc uses optind 0 for (re)initializing internal structures, sigh */ +#ifdef __GLIBC__ + optind = 0; +#else + optind = 1; +#endif + while ((c = getop

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for passing real local arguments to Lua scriptlets (#1383)

2020-10-08 Thread Michael Schroeder
@mlschroe commented on this pull request. > +lua_newtable(L); +if (opts) { + int c, argc = argvCount(args); + +/* glibc uses optind 0 for (re)initializing internal structures, sigh */ +#ifdef __GLIBC__ + optind = 0; +#else + optind = 1; +#endif + while ((c = getop

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for passing real local arguments to Lua scriptlets (#1383)

2020-10-08 Thread Panu Matilainen
@pmatilai pushed 1 commit. 414a92cafebd992a418e1a4d928903b27a4894cb Pass parametric macro options and arguments to Lua natively (#1092) -- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/rpm-software-management/rpm/pull/1383/files/a3c336

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for passing real local arguments to Lua scriptlets (#1383)

2020-10-08 Thread Panu Matilainen
In the last push, Lua can now natively access both parsed options and arguments (see added documentation) I left the %foo(..) part out for now, I'll deal with that separately once this lands to limit the number of moving parts, this was a bit more involved than the initial version... -- You a

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for passing real local arguments to Lua scriptlets (#1383)

2020-10-07 Thread Panu Matilainen
@pmatilai commented on this pull request. > /* Lua scripts can change our cwd and umask, save and restore */ cwd = open(".", O_RDONLY); if (cwd != -1) { mode_t oldmask = umask(0); umask(oldmask); pid_t pid = getpid(); + /* Arrange arguments to appea

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for passing real local arguments to Lua scriptlets (#1383)

2020-10-07 Thread Michael Schroeder
@mlschroe commented on this pull request. > /* Lua scripts can change our cwd and umask, save and restore */ cwd = open(".", O_RDONLY); if (cwd != -1) { mode_t oldmask = umask(0); umask(oldmask); pid_t pid = getpid(); + /* Arrange arguments to appea

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for passing real local arguments to Lua scriptlets (#1383)

2020-10-06 Thread Panu Matilainen
Seems this outgrew the initial description somewhat... The last push makes the new `%foo(..)` syntax for skipping option processing actually usable, the earlier version from a few hours ago had several problems. -- You are receiving this because you are subscribed to this thread. Reply to this

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for passing real local arguments to Lua scriptlets (#1383)

2020-10-06 Thread Michael Schroeder
@mlschroe approved this pull request. -- 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/1383#pullrequestreview-502907388___ Rpm

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for passing real local arguments to Lua scriptlets (#1383)

2020-10-06 Thread Michael Schroeder
Oooh, nice! -- 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/1383#issuecomment-704248771___ Rpm-maint mailing list Rpm-maint@lists

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for passing real local arguments to Lua scriptlets (#1383)

2020-10-06 Thread Panu Matilainen
@pmatilai pushed 2 commits. c8906228da4284660e9d41925e4964b5834de615 Pass parametric macro options and arguments to Lua natively (#1092) 7fb2091a2ed20a8d7f19e1e7ee6c7730d4dc9e36 Allow macros to perform their own option parsing (#547) -- You are receiving this because you are subscribed to t

[Rpm-maint] [rpm-software-management/rpm] Add support for passing real local arguments to Lua scriptlets (#1383)

2020-10-05 Thread Panu Matilainen
Up to now, any communication with Lua scriptlets has required use of global tables. This PR adds support for real argument passing via the internal rpmlua API and converts the install scriptlet machinery to use that. This appears more of a cleanup than new functionality as such, but is a pre-req