Re: [Rpm-maint] [rpm-software-management/rpm] RFE: optional one-shot/cached macro expansion (#1155)

2023-01-03 Thread Panu Matilainen
It's possible in Lua of course, the above was to point out a way to do it *without*, because not everybody is content with Lua. -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/issues/1155#issuecomment-1369490067 You are receiving this because

Re: [Rpm-maint] [rpm-software-management/rpm] RFE: optional one-shot/cached macro expansion (#1155)

2023-01-02 Thread Demi Marie Obenour
What about rewriting the macro in Lua and stashing the result in a Lua global variable? -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/issues/1155#issuecomment-1369167626 You are receiving this because you are subscribed to this thread.

Re: [Rpm-maint] [rpm-software-management/rpm] RFE: optional one-shot/cached macro expansion (#1155)

2023-01-02 Thread Panu Matilainen
FWIW, a simple and generic way to implement this on macro level is to redefine the macro as a global on first evaluation, eg: > %python3_sitearch %{global python3_sitearch %(RPM_BUILD_ROOT= %{__python3} > -Esc "import sysconfig; print(sysconfig.get_path('platlib', vars={'platbase': >

Re: [Rpm-maint] [rpm-software-management/rpm] RFE: optional one-shot/cached macro expansion (#1155)

2020-04-16 Thread Panu Matilainen
Yeah, %define with options is what I'd really like (I think I even mentioned somewhere surrounding the pending %literal). In macro files the name limitation could be abused for similar effect by adding special characters in the front of the name. AIUI rpm5 used "." to denote a read-only

Re: [Rpm-maint] [rpm-software-management/rpm] RFE: optional one-shot/cached macro expansion (#1155)

2020-04-15 Thread Michael Schroeder
Well, we don't need to allow %global. Anyway, let's move a step back and talk about this issue. This is about one shot macros. Implementation wise this is not hard, it's more a question of syntax. It would be nice to have the following options: - literal: do not expand the macro when using it

Re: [Rpm-maint] [rpm-software-management/rpm] RFE: optional one-shot/cached macro expansion (#1155)

2020-04-15 Thread Panu Matilainen
There are other downsides too, such as arbitrary side-effects and code execution on load (as opposed to time of use). -- 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: optional one-shot/cached macro expansion (#1155)

2020-04-15 Thread Michael Schroeder
Crazy thought: we could allow to use %define/%global in the macro file, as those are illegal macro names. I.e. we could allow this: ``` %foo hello %define bar world ``` (rpm internally somewhat rewrites the %foo to %define foo anyway) Then we could also allow ``` %undefine foo ``` which is

Re: [Rpm-maint] [rpm-software-management/rpm] RFE: optional one-shot/cached macro expansion (#1155)

2020-04-02 Thread Panu Matilainen
Well yes, people occasionally get confused about that. The difference is a big one though, its like comparing a shell script with an ini file. Both have their places. -- 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: optional one-shot/cached macro expansion (#1155)

2020-04-01 Thread Vít Ondruch
First seeing spec file and then trying to move some macros into macros file, it was very confusing, I can tell you. From packager POV, the macro file is the same as spec file, but you don't write `%global` everywhere for some unknown reason. Also the difference between `%import` and `%load`

Re: [Rpm-maint] [rpm-software-management/rpm] RFE: optional one-shot/cached macro expansion (#1155)

2020-04-01 Thread Panu Matilainen
Um. And use what instead? The spec file format? Whose parser is the one of the most compilicated and loathed piece of code in rpm and would be difficult to lift out of librpmbuild to put it mildly, and slow every rpm startup in the process? In contrast, the macro file format is a nice,

Re: [Rpm-maint] [rpm-software-management/rpm] RFE: optional one-shot/cached macro expansion (#1155)

2020-04-01 Thread Vít Ondruch
Is there any benefit in having macro files? Wouldn't be better to deprecate them instead? -- 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] RFE: optional one-shot/cached macro expansion (#1155)

2020-04-01 Thread Panu Matilainen
Some macros are really expensive to expand, notorious examples include python/perl/etc related macros that invoke the interpreter to fish out a configuration path or such. When these are expanded repeatedly, it really adds up. In a spec one can use %global to achieve this, but that's not