Re: [Rpm-maint] [rpm-software-management/rpm] Reset global macro state after each spec query/parse (#1067)

2020-02-11 Thread Igor Gnatenko
@pmatilai funny thing is that somebody recently (yesterday) mentioned this bug in the Russian Fedora telegram group and today you come up with the fix :) Can we also backport this to 4.14? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view

[Rpm-maint] [rpm-software-management/rpm] Reset global macro state after each spec query/parse (#1067)

2020-02-11 Thread Panu Matilainen
Parsing a spec, even unsuccessfully, will affect the global macro state in any number of ways that may affect the following operations in unpredictable ways. Lacking any saner way to do this, reset the entire global macro state after each spec parse in rpmspec and spec query code (rpmbuild already

Re: [Rpm-maint] [rpm-software-management/rpm] Make parametric macro arguments available as native Lua table (#1063)

2020-02-11 Thread Jason Tibbitts
Oh, this would be so great. -- 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/1063#issuecomment-585008636___ Rpm-maint mailing

Re: [Rpm-maint] [rpm-software-management/rpm] Handle Python extras trough reverse requirements encoded in provides (#1061)

2020-02-11 Thread Miro Hrončok
Oh. There would be no way to buildrequire an extra. Is that what you mean? That's a problem. -- 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: Syntax sugar for bconds with inherited defaults (#941)

2020-02-11 Thread Petr Viktorin
My old suggestion was `%bcond `, with numeric "default" (zero for false). Aside from "inheritance", it might be used instead of `%bcond_with`/`%bcond_without`. (Whenever I try to choose one, I have to stop and think which one will give me the right default. I don't think I'm alone in that.)

[Rpm-maint] [rpm-software-management/rpm] Use autodetect for _minimize_writes and _flush_io (#1066)

2020-02-11 Thread Florian Festi
This is a take on #949 as described in https://github.com/rpm-software-management/rpm/pull/949#issuecomment-580354653 Original Patch is rebased to have access to the new rpmMacroIsDefined() function. Patches should probably be squashed before merging. Keeped them separate to make review easier.

Re: [Rpm-maint] [rpm-software-management/rpm] Add a --salvagedb option to the rpmdb tool (#1042)

2020-02-11 Thread Panu Matilainen
I'm not all that familiar with ndb internals: how is this different to the regular --rebuilddb just skipping any headers it finds invalid? Or to turn the question around: is there a reason why this could/should not be used on all --rebuilddb operations (on ndb)? -- You are receiving this

Re: [Rpm-maint] [rpm-software-management/rpm] RFE: please add a way to get the unexpanded content of a rpm variable (#582)

2020-02-11 Thread Panu Matilainen
...and perhaps there should be that primitive to entirely suppress macro expansion (as per the %{literal:...} suggestion in #1049, which simply expands to its literal, unexpanded argument. But as literal is a macro type now, maybe that should be called %{verbatim:...} instead. Dunno. -- You

Re: [Rpm-maint] [rpm-software-management/rpm] Implement %{body:...} built-in for retrieving the literal macro body (#1064)

2020-02-11 Thread Panu Matilainen
pmatilai commented on this pull request. > @@ -72,6 +72,7 @@ to perform useful operations. The current list is %define ... define a macro %undefine ... undefine a macro %global ... define a macro whose body is available in global context + %{body:...}

[Rpm-maint] [rpm-software-management/rpm] CI on rawhide disabled temporarily (#1065)

2020-02-11 Thread Panu Matilainen
Some infrastructure issue is causing CI builds on rawhide failing intermittently with "service temporary unavailable" -type errors which go away by persistently resubmitting the builds, but this is not productive use of anybody's time. So as of now, rawhide CI is disabled until further notice.

Re: [Rpm-maint] [rpm-software-management/rpm] Implement %{body:...} built-in for retrieving the literal macro body (#1064)

2020-02-11 Thread Vít Ondruch
voxik commented on this pull request. > @@ -72,6 +72,7 @@ to perform useful operations. The current list is %define ... define a macro %undefine ... undefine a macro %global ... define a macro whose body is available in global context + %{body:...}

Re: [Rpm-maint] [rpm-software-management/rpm] Implement %{body:...} built-in for retrieving the literal macro body (#1064)

2020-02-11 Thread Panu Matilainen
Some open questions: - Should the argument be expanded first, like doFoo() does? Using the literal value has its pros but I guess its cons too. - Is raising an error on undefined macro a reasonable thing to do? If not, what should it do on undefined macros? I was also tempted to add %{opts:...}

[Rpm-maint] [rpm-software-management/rpm] Implement %{body:...} built-in for retrieving the literal macro body (#1064)

2020-02-11 Thread Panu Matilainen
Fixes: #582 You can view, comment on, or merge this pull request online at: https://github.com/rpm-software-management/rpm/pull/1064 -- Commit Summary -- * Implement %{body:...} built-in for retrieving the literal macro body -- File Changes -- M doc/manual/macros (1) M

Re: [Rpm-maint] [rpm-software-management/rpm] RFE: please add a way to get the unexpanded content of a rpm variable (#582)

2020-02-11 Thread Panu Matilainen
Good question, which I think settles the name as well: the argument is a macro name, so it's not the opposite of %{expand:...} at all but a specific thing that in rpm terminology is known as the macro body, so why make this any more complicated... lets just call it %{body:...} and be done with

Re: [Rpm-maint] [rpm-software-management/rpm] Make parametric macro arguments available as native Lua table (#1063)

2020-02-11 Thread Panu Matilainen
RFC only for now: if we do this then we'd really want to export options natively to Lua too, and probably some other 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] Add support for macro-only dependency generators (#1053)

2020-02-11 Thread Florian Festi
Merged #1053 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/1053#event-3025934733___ Rpm-maint mailing list

[Rpm-maint] [rpm-software-management/rpm] Make parametric macro arguments available as native Lua table (#1063)

2020-02-11 Thread Panu Matilainen
Accessing macro arguments via rpm.expand(%1) etc is tedious, non-intuitive and subject to all sorts of expansion issues. Make the argument macros available as a native Lua table (named arg for consistency with -p lua scriptlet arguments) with their literal values - the arguments are already

Re: [Rpm-maint] [rpm-software-management/rpm] RFE: please add a way to get the unexpanded content of a rpm variable (#582)

2020-02-11 Thread Michael Schroeder
Is the argument a macro name or some generic string? I.e. is it `%{body:_builddir}` which should then return ` %{_topdir}/BUILD`? Or is it `%{noexpand:%_builddir}` which then should only do one level of expansion? I find the latter a bit weird. -- You are receiving this because you are

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for macro-only dependency generators (#1053)

2020-02-11 Thread Panu Matilainen
pmatilai commented on this pull request. > @@ -514,6 +514,22 @@ static ARGV_t runCmd(const char *cmd, return output; } +static ARGV_t runCall(const char *cmd, +const char *buildRoot, const char *fn) +{ + +ARGV_t output = NULL; +char *fullcmd = rstrscat(NULL,

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for macro-only dependency generators (#1053)

2020-02-11 Thread Panu Matilainen
Updated to use rpmMacroIsParametric() as the API name, tweaks to commit message(s). -- 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 support for macro-only dependency generators (#1053)

2020-02-11 Thread Panu Matilainen
@pmatilai pushed 2 commits. c2177646458ef20c6d3cfeeddc0fa7ca34c0d50b Add APIs for testing whether a macro is defined and whether its parametric fc98504d59603014edffa53439b96c793ac11f29 Add support for macro-only dependency generators -- You are receiving this because you are subscribed to

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for macro-only dependency generators (#1053)

2020-02-11 Thread Panu Matilainen
pmatilai commented on this pull request. > @@ -1784,6 +1784,29 @@ rpmDefineMacro(rpmMacroContext mc, const char * macro, > int level) return rc; } +int rpmMacroIsDefined(rpmMacroContext mc, const char *n) +{ +int defined = 0; +if ((mc = rpmmctxAcquire(mc)) != NULL) { + if

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for macro-only dependency generators (#1053)

2020-02-11 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/1053#pullrequestreview-356505622___

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for macro-only dependency generators (#1053)

2020-02-11 Thread Panu Matilainen
pmatilai commented on this pull request. > @@ -1784,6 +1784,29 @@ rpmDefineMacro(rpmMacroContext mc, const char * macro, > int level) return rc; } +int rpmMacroIsDefined(rpmMacroContext mc, const char *n) +{ +int defined = 0; +if ((mc = rpmmctxAcquire(mc)) != NULL) { + if

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for macro-only dependency generators (#1053)

2020-02-11 Thread Michael Schroeder
mlschroe commented on this pull request. > @@ -1784,6 +1784,29 @@ rpmDefineMacro(rpmMacroContext mc, const char * macro, > int level) return rc; } +int rpmMacroIsDefined(rpmMacroContext mc, const char *n) +{ +int defined = 0; +if ((mc = rpmmctxAcquire(mc)) != NULL) { + if