Re: [Rpm-maint] [rpm-software-management/rpm] Add API for clone rpmps iterator (func rpmpsiClone) (#1359)

2020-10-28 Thread Panu Matilainen
After mulling over this some more... as per above comments, sorry but no. There are several key iterators where we couldn't support this even if we wanted to, so adding it for one or two would only make both the C API and the C++ wrapper more inconsistent instead of improving it. -- You are

Re: [Rpm-maint] [rpm-software-management/rpm] Do not fail if there is no "$temp"/res.* file (#1391)

2020-10-28 Thread Panu Matilainen
Sorry, managed to forget this whole thing. Yeah much better now, thanks! -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Add new rpmExpandThisMacro() public method (#1414)

2020-10-28 Thread Panu Matilainen
Names are annoying... for a theme that's used elsewhere in rpm too, mbInit() and mbFini() maybe? Also seems to me in that the mbAllocBuf() calls could be moved to the start/init-part too. But yeah much nicer this way, regardless of names. -- You are receiving this because you are subscribed to

[Rpm-maint] [rpm-software-management/rpm] Silence warnings from newer Doxygen (#1417)

2020-10-28 Thread Panu Matilainen
You can view, comment on, or merge this pull request online at: https://github.com/rpm-software-management/rpm/pull/1417 -- Commit Summary -- * Fix some Doxygen grouping artifacts (aka bugs) * Shut up bogus Doxygen warnings about undocumented parameters -- File Changes -- M

Re: [Rpm-maint] [rpm-software-management/rpm] Add brief tag documentation for all actively used header tags (#1415)

2020-10-28 Thread Panu Matilainen
Merged #1415 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/1415#event-3930574338___ Rpm-maint mailing list

Re: [Rpm-maint] [rpm-software-management/rpm] Possible deadlock when macro tracing and debug is turned on (#1418)

2020-10-28 Thread Panu Matilainen
Looks like https://bugzilla.redhat.com/show_bug.cgi?id=613010 was the background to diverting the spew to the debug log, but I'm not sure that is such a constructive thing to do because it now doesn't even say which macro we tripped on. rpmlog() is used in multiple places in macros.c so we'll

Re: [Rpm-maint] [rpm-software-management/rpm] Add brief tag documentation for all actively used header tags (#1415)

2020-10-28 Thread Panu Matilainen
@pmatilai commented on this pull request. > @@ -3,96 +3,296 @@ ## Base package tags * Name (1000) string This is about the package format, not spec tags. The numbers are the tag ID's that the physical headers have, the names are entirely for human convenience. -- You are receiving this

Re: [Rpm-maint] [rpm-software-management/rpm] Add brief tag documentation for all actively used header tags (#1415)

2020-10-28 Thread Panu Matilainen
@pmatilai pushed 1 commit. cd97f67b09866401d14e89c8227b1b894b1f7f99 Reorganize the ancient spec tag blurb into a new beginning -- You are receiving this because you are subscribed to this thread. View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Eliminate Python and SELinux deprecation warnings (#1416)

2020-10-28 Thread Panu Matilainen
Merged #1416 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/1416#event-3930002415___ Rpm-maint mailing list

Re: [Rpm-maint] [rpm-software-management/rpm] Silence warnings from newer Doxygen (#1417)

2020-10-28 Thread Panu Matilainen
Merged #1417 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/1417#event-3930003792___ Rpm-maint mailing list

Re: [Rpm-maint] [rpm-software-management/rpm] Add brief tag documentation for all actively used header tags (#1415)

2020-10-28 Thread Panu Matilainen
Added overlapping extension tags + a link from queryformat docs. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Add brief tag documentation for all actively used header tags (#1415)

2020-10-28 Thread Panu Matilainen
@pmatilai pushed 1 commit. 2487579c91d57017238919f5c8513b4ab8153129 Document (however briefly) all our actively used header tags -- You are receiving this because you are subscribed to this thread. View it on GitHub:

[Rpm-maint] [rpm-software-management/rpm] Eliminate Python and SELinux deprecation warnings (#1416)

2020-10-28 Thread Panu Matilainen
You can view, comment on, or merge this pull request online at: https://github.com/rpm-software-management/rpm/pull/1416 -- Commit Summary -- * Stop using deprecated security_context_t * Replace uses of deprecated PyEval_CallObject() with PyObject_Call() -- File Changes -- M

Re: [Rpm-maint] [rpm-software-management/rpm] Add brief tag documentation for all actively used header tags (#1415)

2020-10-28 Thread Panu Matilainen
@pmatilai commented on this pull request. > * Version (1001) string + + Package version. Look, this is not a finished book which will go to press and never revisited again. It's about gradually doing *at least something*, and if I start worrying about making it perfect, it's simply going

Re: [Rpm-maint] [rpm-software-management/rpm] Add brief tag documentation for base and file tags (#1415)

2020-10-27 Thread Panu Matilainen
@pmatilai pushed 1 commit. 97aa3a0bd7b70d476f53f6cd2e97124fb1f2ad83 Document extensions and other miscellania -- You are receiving this because you are subscribed to this thread. View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Add brief tag documentation for base and file tags (#1415)

2020-10-27 Thread Panu Matilainen
@pmatilai pushed 1 commit. c2ae1157f42579d4813e56e8af47ccf8262b6c26 Add brief explanations to scriptlets and trigger tags -- You are receiving this because you are subscribed to this thread. View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Add new rpmExpandThisMacro() public method (#1414)

2020-10-27 Thread Panu Matilainen
Yet another BTW: I don't think it would be unreasonable to expect rpmExpandThisMacro() callers to supply the macro name as the first argument of the argv (similar to the exec() family of functions) so we wouldn't need to copy that internally just because - the caller knows the name and has to

Re: [Rpm-maint] [rpm-software-management/rpm] Add brief tag documentation for base and file tags (#1415)

2020-10-27 Thread Panu Matilainen
@pmatilai pushed 3 commits. 4c4fc57d935561519c8231c2f19edad2ee8359ee Add brief explanations of signature/digest tags b8a2c61c12118842423eb7c9b8492fcd39a6f178 Add explanations on installed-only tags c1201a0b3cbc5518aba66e2bf66f14bd4a62138b Add source package tag doc -- You are receiving

Re: [Rpm-maint] [rpm-software-management/rpm] Add new rpmExpandThisMacro() public method (#1414)

2020-10-27 Thread Panu Matilainen
@Conan-Kudo , the point is that Python and macros reside on different levels of existence entirely. In the embedded Lua realm, you *are* a macro most of the time, whereas Python only sometimes casually observes the value from the outside. Nobody is forbidding folks from adding more

[Rpm-maint] [rpm-software-management/rpm] Add brief tag documentation for base and file tags (#1415)

2020-10-27 Thread Panu Matilainen
You can view, comment on, or merge this pull request online at: https://github.com/rpm-software-management/rpm/pull/1415 -- Commit Summary -- * Add brief tag documentation for base and file tags -- File Changes -- M doc/manual/tags.md (234) -- Patch Links --

Re: [Rpm-maint] [rpm-software-management/rpm] Add new rpmExpandThisMacro() public method (#1414)

2020-10-27 Thread Panu Matilainen
> spectool was rewritten to use RPM Python bindings, so I imagine at least it > would matter for that tool. Hardly. There's precisely *one* rpm.expandMacro() in the entire new spectool code, and that doesn't involve parametric macros or anything else advanced, it's merely to expand

Re: [Rpm-maint] [rpm-software-management/rpm] Add new rpmExpandThisMacro() public method (#1414)

2020-10-27 Thread Panu Matilainen
@pmatilai commented on this pull request. > - - /* Recursively expand body of macro */ - if (me->body && *me->body) { - if ((me->flags & ME_LITERAL) != 0) - mbAppendStr(mb, me->body); - else - expandMacro(mb, me->body, 0); - } -

Re: [Rpm-maint] [rpm-software-management/rpm] Add new rpmExpandThisMacro() public method (#1414)

2020-10-27 Thread Panu Matilainen
Okay, just for the reference, I suggested considering using an error code instead of NULL: https://github.com/rpm-software-management/rpm/pull/34 but as to how that turned into -1/1 I plead innocent :D The documented "return negative on error" would allow changing it to return 0 on success

Re: [Rpm-maint] [rpm-software-management/rpm] Add new rpmExpandThisMacro() public method (#1414)

2020-10-27 Thread Panu Matilainen
Heh, I almost commented on the return code thing, before noticing that it was actually to be same as rpmExpandMacro(). There was a kind of a reason for the return code to be like that, basically to leave room for returning more information in the future (but I don't recall if there was an

Re: [Rpm-maint] [rpm-software-management/rpm] Add new rpmExpandThisMacro() public method (#1414)

2020-10-26 Thread Panu Matilainen
Oh and BTW, there's actually an existing use-case for this in the code-base: this is exactly what runCall() in build/rpmfc.c wants. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Add new rpmExpandThisMacro() public method (#1414)

2020-10-26 Thread Panu Matilainen
...except that's exactly where it starts getting trickier: from Lua the argv is differently allocated and shouldn't be freed in freeArgs() and at least in my version there was "fun" with me->opts processing retriggering the option processing when it shouldn't have, etc. But many details are

Re: [Rpm-maint] [rpm-software-management/rpm] Add new rpmExpandThisMacro() public method (#1414)

2020-10-26 Thread Panu Matilainen
I can pick up the Lua side once this is merged, no need to redo all that. As for Python, the bindings wrt macros are really primitive as it is and nobody is complaining so I dunno if anybody cares. At any rate, I don't consider that a requirement for merging. -- You are receiving this because

Re: [Rpm-maint] [rpm-software-management/rpm] Add new rpmExpandThisMacro() public method (#1414)

2020-10-26 Thread Panu Matilainen
Ah, making a copy of the argv so the allocation business is different from what I had. https://github.com/pmatilai/rpm/tree/luamt-2 is a quick "port" on top of this and the basic testcases pass as-is, but only very briefly tested. -- You are receiving this because you are subscribed to this

Re: [Rpm-maint] [rpm-software-management/rpm] lib/rpmrc.c: include fcntl.h for O_* (#1413)

2020-10-26 Thread Panu Matilainen
Merged #1413 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/1413#event-3920037615___ Rpm-maint mailing list

Re: [Rpm-maint] [rpm-software-management/rpm] lib/rpmrc.c: include fcntl.h for O_* (#1413)

2020-10-26 Thread Panu Matilainen
@pmatilai approved this pull request. Was about to say "didn't we just fix this already" but seems that was some other place (9395bdc6445935763842e7a28304b4d76301) for the very same reason... Thanks. -- You are receiving this because you are subscribed to this thread. Reply to this

Re: [Rpm-maint] [rpm-software-management/rpm] Refactor handling of parameterized macro args (#1412)

2020-10-26 Thread Panu Matilainen
@pmatilai approved this pull request. Not entirely unlike what I in my own version :smile: -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Refactor handling of parameterized macro args (#1412)

2020-10-26 Thread Panu Matilainen
Merged #1412 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/1412#event-3918960394___ Rpm-maint mailing list

Re: [Rpm-maint] [rpm-software-management/rpm] Fix logic error in grabArgs() (#1411)

2020-10-23 Thread Panu Matilainen
Merged #1411 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/1411#event-3913752156___ Rpm-maint mailing list

Re: [Rpm-maint] [rpm-software-management/rpm] Fix logic error in grabArgs() (#1411)

2020-10-23 Thread Panu Matilainen
Thanks :) -- 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/1411#issuecomment-715316965___ Rpm-maint mailing list

Re: [Rpm-maint] [rpm-software-management/rpm] Fix logic error in grabArgs() (#1411)

2020-10-23 Thread Panu Matilainen
@pmatilai commented on this pull request. > @@ -948,7 +948,7 @@ grabArgs(MacroBuf mb, const rpmMacroEntry me, const char > * se, splitQuoted(, s, " \t"); free(s); - cont = ((*lastc == '\0' || *lastc == '\n') && *(lastc-1) != '\\') ? + cont = *lastc == '\0' ||

Re: [Rpm-maint] [rpm-software-management/rpm] Fix warnings from set but unused, variables in macro.c and rpmlua.c (#1410)

2020-10-23 Thread Panu Matilainen
Merged #1410 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/1410#event-3913626616___ Rpm-maint mailing list

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a real stack for parametric macro locals (#1409)

2020-10-23 Thread Panu Matilainen
Updated to preserve the scoped macro behavior, ie the example case now expands to `hello` again. Just wondering now whether all these macro tables actually make sense - with these semantics we could probably get by with just two tables for global and non-global macros. It's the argv stuff that

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a real stack for parametric macro locals (#1409)

2020-10-23 Thread Panu Matilainen
Oh and FWIW, I've various other doubts and reservations about this implementation so there's a good chance that it'll end up trashed (or at least drastically revised) anyhow. If getting an actual definition and some testcases of how macro scoping is supposed to work comes out of it, that alone

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a real stack for parametric macro locals (#1409)

2020-10-23 Thread Panu Matilainen
Right, I forgot that user-defined scoped macros follow different rules from automatic macros as it is. Which is of course undocumented behavior, like most of all this... What's implemented here is a strict local stack for parametric macros, so no, it no longer expands to `hello` unless you

[Rpm-maint] [rpm-software-management/rpm] Fix warnings from set but unused, variables in macro.c and rpmlua.c (#1410)

2020-10-23 Thread Panu Matilainen
macro.c: In function ‘mbopt’: macro.c:895:19: warning: unused variable ‘me’ [-Wunused-variable] 895 | rpmMacroEntry me = mb-me; | ^~ rpmlua.c: In function ‘fd_seek’: rpmlua.c:985:22: warning: unused variable ‘mode’ [-Wunused-variable] 985 | static const int

Re: [Rpm-maint] [PATCH] Remove set, but unused, variables in macro.c and rpmlua.c

2020-10-23 Thread Panu Matilainen
On 10/23/20 1:58 PM, Mark Wielaard wrote: macro.c: In function ‘mbopt’: macro.c:895:19: warning: unused variable ‘me’ [-Wunused-variable] 895 | rpmMacroEntry me = mb->me; | ^~ rpmlua.c: In function ‘fd_seek’: rpmlua.c:985:22: warning: unused variable ‘mode’

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a real stack for parametric macro locals (#1409)

2020-10-22 Thread Panu Matilainen
FWIW, the macro argument argv needs similar treatment but I'm out of steam for the day... -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

[Rpm-maint] [rpm-software-management/rpm] Implement a real stack for parametric macro locals (#1409)

2020-10-22 Thread Panu Matilainen
Mixing up local stack and global data never was such a hot idea, as locals could get trapped between globals and not freed at appropriate times etc. This clears the semantics wrt that, fixing a long-standing expected failure in the test-suite. Another semantics change is that you can no

Re: [Rpm-maint] [rpm-software-management/rpm] Add preliminary support for dynamic built-in macro registration (#1406)

2020-10-22 Thread Panu Matilainen
Pushed a bit more elaborate/sophisticated version... -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-21 Thread Panu Matilainen
> I'll try to get it into a submittable state tomorrow or so. ...except that nope, didn't see a way to achieve this with a reasonable effort. Doesn't necessarily mean there isn't one, but I lost my appetite for now. I might revisit at some later time, but if somebody wants to pick up the pieces

[Rpm-maint] [rpm-software-management/rpm] Add preliminary support for dynamic built-in macro registration (#1406)

2020-10-21 Thread Panu Matilainen
Add the necessary infra to pass and carry dofoo/parse function pointers in macro entries, define our basic built-in primitives at macro initialization and adapt the built-in calling logic in expandMacro() to look up the info from macro entry instead of the builtin table. This has various nice

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-21 Thread Panu Matilainen
No worries. I got tangled in the argument/option parsing/passing recursion - I've a feeling the mb->args vs argument macros and all isn't quite right as it is, and just ran out of steam for now. So I was actually kinda hoping you'd say that... Meanwhile, here's a related step towards making

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-21 Thread Panu Matilainen
Closed #1398. -- 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/1398#event-3902168598___ Rpm-maint mailing list

Re: [Rpm-maint] [rpm-software-management/rpm] Mark man pages with RPMFILE_MAN and info pages with RPMFILE_INFO (#1404)

2020-10-20 Thread Panu Matilainen
Closed #1404. -- 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/1404#event-3897185281___ Rpm-maint mailing list

Re: [Rpm-maint] [rpm-software-management/rpm] Mark man pages with RPMFILE_MAN and info pages with RPMFILE_INFO (#1404)

2020-10-20 Thread Panu Matilainen
Sorry but no: a bitfield does not scale for classifying individual file formats, and that's not what the virtual file attributes are for. A `file` magic string is attached to most files (RPMTAG_FILECLASS extension) which can be used for further identification, but it's not terribly reliable as

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-19 Thread Panu Matilainen
> you should add a `rpmExpandThisMacro(rpmMacroContext mc, const char *n, > ARGV_t args)` function which can be used to expand macro `n` with the > provided args without needing the rpmExpand arg hackery. Note that this call > would not expand the arguments. @mlschroe , it's not so much that

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-19 Thread Panu Matilainen
Now that the table version exists, I don't feel any particular need to hang on to the multi-argument auto-join thing. The convenience of not having to manually and tediously construct the string was the point of that, but since *that* can be avoided with the table syntax, eliminating the string

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-19 Thread Panu Matilainen
Rebased again to include the other new Lua/macro stuff and a new snapshot build at https://copr.fedorainfracloud.org/coprs/pmatilai/rpm-snapshot/build/1712012/ -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] RFE: add some syntax to specify a macro should not fail when used with a flag not declared to rpm argument parsing (#547)

2020-10-19 Thread Panu Matilainen
Closed #547 via #1392. -- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/issues/547#event-3892043975___ Rpm-maint mailing list Rpm-maint@lists.rpm.org

Re: [Rpm-maint] [rpm-software-management/rpm] Get rid of the Lua variable wrapper API (#1402)

2020-10-19 Thread Panu Matilainen
Okay, guess nobody's complaining about getting rid of piles of dusty-moldy code... -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-19 Thread Panu Matilainen
After some more consideration, renamed to `macros`. This is more in line with our other globals (sources, patches) and leaves room for iteration options in the future. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-19 Thread Panu Matilainen
@pmatilai pushed 1 commit. 81e1068bf1193bceb0ca8c6abb3be95c250eb3ee Implement a table-like shortcut to rpm macros in Lua -- You are receiving this because you are subscribed to this thread. View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-19 Thread Panu Matilainen
Updated to have function calls only accept a single string or table. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-19 Thread Panu Matilainen
@pmatilai pushed 1 commit. 7d1d772be5f2cdf8d4ecb0a0dcc79514ab1c9658 Implement a table-like shortcut to rpm macros in Lua -- You are receiving this because you are subscribed to this thread. View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-19 Thread Panu Matilainen
On a related note on the builtins: I've been thinking about turning the builtins into parametric macros, or at least blur the difference considerably (and allow dynamic registering of builtins). The syntax differs a bit and the calling convention much more, so it's not entirely

Re: [Rpm-maint] [rpm-software-management/rpm] Allow parametric macros to opt out of option processing (#547) (#1392)

2020-10-19 Thread Panu Matilainen
Merged #1392 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/1392#event-3892043957___ Rpm-maint mailing list

Re: [Rpm-maint] [rpm-software-management/rpm] Allow parametric macros to opt out of option processing (#547) (#1392)

2020-10-19 Thread Panu Matilainen
Since there's no further feedback... -- 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/1392#issuecomment-711832987___ Rpm-maint

Re: [Rpm-maint] [rpm-software-management/rpm] Get rid of the Lua variable wrapper API (#1402)

2020-10-19 Thread Panu Matilainen
Merged #1402 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/1402#event-3891995092___ Rpm-maint mailing list

[Rpm-maint] [rpm-software-management/rpm] Get rid of the Lua variable wrapper API (#1402)

2020-10-15 Thread Panu Matilainen
See commits for details, the main point is getting rid of an unmaintained, undocumented and unloved intermediate Lua variable API. As an example, the sources/patches table manipulation is converted to use native Lua operations, and is actually less code and easier to understand that the helper

Re: [Rpm-maint] [rpm-software-management/rpm] Get rid of the Lua variable wrapper API (#1402)

2020-10-15 Thread Panu Matilainen
@pmatilai pushed 2 commits. 0a2f461c9194f6c18090f6efea783506e81f80e3 Convert sources/patches table manipulation to "native" Lua API 5881539aee1888156a4316d5be941a4ba26af38a Lose the internal Lua variable API -- You are receiving this because you are subscribed to this thread. View it on

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-15 Thread Panu Matilainen
Okay, iteration is a fair point. The catch is that we don't support that at all, and I'm not sure we ever will. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-15 Thread Panu Matilainen
Updated: - macro call arguments are auto-quoted if passed as a table - more docs on the behavior - build the strings on Lua side and use Lua rpm.expand() call consistently for all macro expansions -- You are receiving this because you are subscribed to this thread. Reply to this email directly

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-15 Thread Panu Matilainen
@pmatilai pushed 1 commit. 252c9360f6572836f903c05470f7ced5c09e57e8 Implement a table-like shortcut to rpm macros in Lua -- You are receiving this because you are subscribed to this thread. View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-15 Thread Panu Matilainen
The plural form could be argued, yes. I considered it, but somehow it seems weird to me in this context, in particular the dot-syntax (eg `macros.with('foo')`). Do you have some concrete reason why `macro['_libdir']` seems objectionable to you? I'm just curious, as I actually find that more

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-14 Thread Panu Matilainen
Regarding the auto-quotation behavior, I think we could leave that up to the caller, the Lua table syntax lends itself to this nicely: ``` res = macro.foo(1, 2, 3) res = macro.foo({1, 2, 3}) ``` In the first case, no automatic quotation is done so it's *literally* equivalent of joining the

Re: [Rpm-maint] [rpm-software-management/rpm] Treat unparsable macros like undefined macros (#1400)

2020-10-14 Thread Panu Matilainen
@pmatilai approved this pull request. Nice spotting, thanks! -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-14 Thread Panu Matilainen
This is starting to spin out of scope... This PR is not about changing parametric macro semantics at all, it's about making them more accessible from Lua, and basically I think results need to be identical between `rpm.expand('%foo [...])` and `macro.foo([...])` or everybody will go crazy.

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-14 Thread Panu Matilainen
Updated: - rename the global `m` table to `macro`, it's indeed better for readability - implement undefine via nil assignment - automatically quote parametric macro arguments when called as Lua function - rebased - new build of this state at

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-14 Thread Panu Matilainen
@pmatilai pushed 1 commit. 495252a69443f1987990404aa8b211d0f6bc2148 Implement a table-like shortcut to rpm macros in Lua -- You are receiving this because you are subscribed to this thread. View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-14 Thread Panu Matilainen
> But then you should change the code so that it does not accept more than one > argument. Everything else is not "identical" and does not match the user > expectation. Hmm. I fail to see the problem here, it's just a shortcut for building that string yourself, ie these two should be equal:

Re: [Rpm-maint] [rpm-software-management/rpm] Treat unparsable macros like undefined macros (#1400)

2020-10-14 Thread Panu Matilainen
Merged #1400 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/1400#event-3875857202___ Rpm-maint mailing list

Re: [Rpm-maint] [rpm-software-management/rpm] Treat unparsable macros like undefined macros (#1400)

2020-10-14 Thread Panu Matilainen
Ah but it's just for the empty %{} case, which shouldn't be all that common, initially thought it covered other undefined stuff too. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Treat unparsable macros like undefined macros (#1400)

2020-10-14 Thread Panu Matilainen
It's also old... that assignment traces back all the way to the initial addition of the current macro system in 1998 (commit 94f5fbeec363059ca9eb986ee294ffcdf20bcb04) -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Treat unparsable macros like undefined macros (#1400)

2020-10-14 Thread Panu Matilainen
Oh fun. I wonder how many spec oddities ("just how many :cursing_face: percents do I need to escape this..." etc) are explained by this... -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-14 Thread Panu Matilainen
But in the function call, we just catenate the args into a string that gets passed plain old rpmExpand(), so if one method expands them and the other doesn't, you can get quite different results. Which doesn't seem sane. -- You are receiving this because you are subscribed to this thread.

Re: [Rpm-maint] [rpm-software-management/rpm] Allow parametric macros to opt out of option processing (#547) (#1392)

2020-10-14 Thread Panu Matilainen
@pmatilai pushed 1 commit. 5125725009f5ad50adf5a574b9e9f2fac16af13b fixup! Wrap getopt() usage into internal helper -- You are receiving this because you are subscribed to this thread. View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Allow parametric macros to opt out of option processing (#547) (#1392)

2020-10-14 Thread Panu Matilainen
Oh, another good point. I probably had some vague idea about letting the callback handle errors if it wants, but it wasn't all that carefully thought out as you can see :sweat_smile: I'll drop optopt from being passed, the current implementation doesn't need it and this is a private helper

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-14 Thread Panu Matilainen
Calling a parametric macro as a function vs traditional rpm.expand() needs to behave identically as the *called* macro will have no idea about any of this. Auto-quoting is of course already on a slippery slope. -- You are receiving this because you are subscribed to this thread. Reply to this

Re: [Rpm-maint] [rpm-software-management/rpm] Allow parametric macros to opt out of option processing (#547) (#1392)

2020-10-14 Thread Panu Matilainen
Fixed to pass optopt around instead of opterr. -- 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/1392#issuecomment-708228238___

Re: [Rpm-maint] [rpm-software-management/rpm] Allow parametric macros to opt out of option processing (#547) (#1392)

2020-10-13 Thread Panu Matilainen
Yeah, thanks for spotting. Will fix. -- 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/1392#issuecomment-708172511___ Rpm-maint

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-13 Thread Panu Matilainen
Yup. The reason it's not there now is that from wherever I had this idea it might prevent macro expansion in said arguments, and somehow never got around to check what it actually did :roll_eyes: (I'm getting old, it's just three years since I added that thing...) Now actually checking, yeah

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-13 Thread Panu Matilainen
Other random remarks of the day: - We could of course put it into rpm namespace, and macro-heavy users can declare their own shortcut, eg `m = rpm.macro; m._libdir = "foo"`, but then if every Lua macro starts with that, we've failed somewhere - This doesn't enable *anything* new, it's all just

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-13 Thread Panu Matilainen
Could of course call the table `macro`to make it blindingly obvious what that is, although I do think the context makes it quite clear anyhow. It's not like rpm macros ever were nice or readable to begin with :stuck_out_tongue_winking_eye: Macros are by far the most accessed thing from rpm

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-13 Thread Panu Matilainen
It stops being nice and short if we put it into the rpm namespace :-/ Unlike a generic Lua library extension, rpm owns the environment in which these things run so I don't see a reason we couldn't maximise the convenience. Too bad `%` is not a legitimate character in Lua names... OTOH, `_` is

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-13 Thread Panu Matilainen
https://copr.fedorainfracloud.org/coprs/pmatilai/rpm-snapshot/ has pre-built binaries for Fedora, updated manually once/twice a week. Usually those are strictly from rpm git master but it's not like I can't make exceptions...

Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-13 Thread Panu Matilainen
See the docs + test cases in the commit for details, if something isn't covered then do ask. There's ample potential for bikeshedding here (eg what to call the global table), should it do some sort of auto-quoting for empty strings as arguments etc. Tagging @hroncok @nim-nim @mlschroe

[Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-13 Thread Panu Matilainen
Add rpm macro context as a global table-like entity named m for typing convenience into the Lua environment. Support basic access with table indexing syntaxes (m[k] and m.k), undefined macros return nil here. As a specialty, parametric macros are returned as native callable variadic Lua

Re: [Rpm-maint] [rpm-software-management/rpm] RFE: add variable named scoping to rpm (#1150)

2020-10-12 Thread Panu Matilainen
Coming across this again - nope. Understanding what happens where and when across the boundary between macros and build scriptlets is hard enough as it is, adding namespaces and scopes would only make it so much worse. Judging by the examples given, the idea is to better support multiple

Re: [Rpm-maint] [rpm-software-management/rpm] [RFE] Autogenerate source archive decompression dependencies (#1396)

2020-10-12 Thread Panu Matilainen
Yup, it's not a new idea, we've even had a ticket for it but that's probably gotten lost in the jump to GH. I had a PoC that threw sources at %{uncompress:...} and grabbed the result up to the first space, which kinda works but of course has the limitation of not supporting executables with

Re: [Rpm-maint] [rpm-software-management/rpm] RFE: pass parametric macro options and arguments to Lua natively (#1092)

2020-10-12 Thread Panu Matilainen
@nim-nim : One shouldn't expect `nil == false` any more than one would expect `"yes" == true`, although both sides *evaluate to* true, ie `("yes" and true)` *is* true. The language documentation is quite explicit about this, and this has wonderfully little to do with rpm or the interface it

Re: [Rpm-maint] [rpm-software-management/rpm] elfdeps: Generate dependencies on non-executable shared libraries (#1393)

2020-10-12 Thread Panu Matilainen
And here's the buildroot policy approach: #1395 -- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/pull/1393#issuecomment-707023565___ Rpm-maint mailing

Re: [Rpm-maint] [rpm-software-management/rpm] RFE: pass parametric macro options and arguments to Lua natively (#1092)

2020-10-12 Thread Panu Matilainen
> What I objected here is exposing false instead of nil when something is unset. But there's no such thing in the PR linked to this item at all! That's what's so frustrating to me here and why I've been urging you to look at what was actually implemented for this ticket:

Re: [Rpm-maint] [rpm-software-management/rpm] RFE: add variable named scoping to rpm (#1150)

2020-10-12 Thread Panu Matilainen
Closed #1150. -- 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/1150#event-3866708604___ Rpm-maint mailing list

Re: [Rpm-maint] [rpm-software-management/rpm] Generate requires for "pure" ELF DSO's regardless of executable bit (#1394)

2020-10-12 Thread Panu Matilainen
This is RFC only as it's not clear we actually want this particular behavior, there might be better ways to achieve the goal of not having a system full of non-executable files with executable bit set. -- You are receiving this because you are subscribed to this thread. Reply to this email

Re: [Rpm-maint] [rpm-software-management/rpm] elfdeps: Generate dependencies on non-executable shared libraries (#1393)

2020-10-12 Thread Panu Matilainen
A different kind of approach to the issue could be continuing to require executable bit for requires generation, but have a brp-script strip the x-bits from all ET_DYN files that are not actually executable. eu-elfclassify could probably be used for that... -- You are receiving this because

  1   2   3   4   5   6   7   8   9   10   >