Re: [Rpm-maint] [rpm-software-management/rpm] Support triple operator for conditional shortcut (#115) (#746)

2019-09-23 Thread Panu Matilainen
Superceded by @mlschroe 's work to add ternary operator to expression parsing and wiring all that into the macro engine, closing. Thanks @pavlinamv for your initiative on this though, I do think it was vital for getting the ball rolling on the whole thing! -- You are receiving this because

Re: [Rpm-maint] [rpm-software-management/rpm] Support triple operator for conditional shortcut (#115) (#746)

2019-09-23 Thread Panu Matilainen
Closed #746. -- 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/746#event-2653949216___ Rpm-maint mailing list

Re: [Rpm-maint] [rpm-software-management/rpm] Support triple operator for conditional shortcut (#115) (#746)

2019-08-12 Thread Panu Matilainen
As mentioned in the ticket (#115), I want to see a plan for a syntax that allows for generic condition instead of just existence test before proceeding. Also mentioned in the ticket, the syntax has other issues too. Lets discuss those in the ticket to keep it all in one place. @pavlinamv ,

Re: [Rpm-maint] [rpm-software-management/rpm] Support triple operator for conditional shortcut (#115) (#746)

2019-08-06 Thread pavlinamv
Support for extra spaces is ripped out. -- 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/746#issuecomment-518617194___ Rpm-maint

Re: [Rpm-maint] [rpm-software-management/rpm] Support triple operator for conditional shortcut (#115) (#746)

2019-08-05 Thread Panu Matilainen
pmatilai requested changes on this pull request. If I interpret that correctly, you just dismiss all the spaces that might be there. So what if you WANT to emit spaces? Also, the triple syntax has to give the same exact results as doing the same thing without the older conditional operator for

Re: [Rpm-maint] [rpm-software-management/rpm] Support triple operator for conditional shortcut (#115) (#746)

2019-08-05 Thread pavlinamv
> And how do you're supposed to know which spaces before and after the 0/1 are > intentional or not? This must expand literally to either " 0 " or " 1". According to the specification of triple operator - all spaces - after '%{?!' or '%{?', - before and after ':' that divides the operator and -

Re: [Rpm-maint] [rpm-software-management/rpm] Support triple operator for conditional shortcut (#115) (#746)

2019-08-05 Thread Panu Matilainen
``` %global with_lua %{?{_without_lua} : 0 : 1} ``` And how do you're supposed to know which spaces before and after the 0/1 are intentional or not? This *must* expand literally to either " 0 " or " 1". Rip support for the "courtesy" spaces everywhere. -- You are receiving this because you

Re: [Rpm-maint] [rpm-software-management/rpm] Support triple operator for conditional shortcut (#115) (#746)

2019-07-09 Thread pavlinamv
> The exact syntax is subject to endless bikeshedding of course, but one thing > that strikes me as just wrong are the surrounding spaces everywhere. There > are no "courtesy spaces" for readability anywhere in rpm macros, I dont think > this should be any different. Here are 2 relevant

Re: [Rpm-maint] [rpm-software-management/rpm] Support triple operator for conditional shortcut (#115) (#746)

2019-06-20 Thread Panu Matilainen
The exact syntax is subject to endless bikeshedding of course, but one thing that strikes me as just wrong are the surrounding spaces everywhere. There are no "courtesy spaces" for readability anywhere in rpm macros, I dont think this should be any different. This also makes me wonder if it's

Re: [Rpm-maint] [rpm-software-management/rpm] Support triple operator for conditional shortcut (#115) (#746)

2019-06-20 Thread Panu Matilainen
> It is a small functional change. But the change is unimportant, because it includes only some of %load macros with more than one '?'. Like: %{!??load:file} %{!???load:file} or %{!!!??load:file} All this talk about a change, but it fails to explain what that change of behavior actually *is*.

Re: [Rpm-maint] [rpm-software-management/rpm] Support triple operator for conditional shortcut (#115) (#746)

2019-06-20 Thread Panu Matilainen
pmatilai commented on this pull request. > str++; } return str; } +static void partsInit(macroPartition *parts) +{ +parts->f = parts->fe = NULL; +parts->g = parts->ge = NULL; +parts->h = parts->he = NULL; +parts->fn = parts->gn = parts->hn = 0; +return;

Re: [Rpm-maint] [rpm-software-management/rpm] Support triple operator for conditional shortcut (#115) (#746)

2019-06-20 Thread Panu Matilainen
pmatilai commented on this pull request. > @@ -45,6 +45,12 @@ enum macroFlags_e { ME_USED= (1 << 1), }; +enum checkConditionType { +CHK_NO = 0, +CHK_BASIC = (1 << 0), +CHK_TRIPLE = (1 << 1), +}; CHK_NO sounds like something that wants to

Re: [Rpm-maint] [rpm-software-management/rpm] Support triple operator for conditional shortcut (#115) (#746)

2019-06-20 Thread Panu Matilainen
pmatilai commented on this pull request. > +return; +} + +static void setPartsSize(macroPartition *parts) +{ +parts->fn = parts->fe - parts->f; +parts->gn = parts->ge - parts->g; +parts->hn = parts->he - parts->h; +return; +} + +/** + * Skip spaces before the input string +

Re: [Rpm-maint] [rpm-software-management/rpm] Support triple operator for conditional shortcut (#115) (#746)

2019-06-20 Thread Panu Matilainen
pmatilai commented on this pull request. > +SKIPBLANK(parts->g, c); + +/* after %{? {macroo} must be ':' */ +if (parts->g[0] == ':') { + parts->g++; + SKIPBLANK(parts->g,c); + parts->ge = parts->g; + while ((parts->ge[0] != 0) && (parts->ge[0] != ':')) { +

Re: [Rpm-maint] [rpm-software-management/rpm] Support triple operator for conditional shortcut (#115) (#746)

2019-06-20 Thread Panu Matilainen
pmatilai commented on this pull request. > +if (parts->g[0] == ':') { + parts->g++; + SKIPBLANK(parts->g,c); + parts->ge = parts->g; + while ((parts->ge[0] != 0) && (parts->ge[0] != ':')) { + parts->ge++; + if (parts->ge[0] == '{') { +

Re: [Rpm-maint] [rpm-software-management/rpm] Support triple operator for conditional shortcut (#115) (#746)

2019-06-20 Thread Panu Matilainen
pmatilai commented on this pull request. > + SKIPBLANK(parts->g,c); + parts->ge = parts->g; + while ((parts->ge[0] != 0) && (parts->ge[0] != ':')) { + parts->ge++; + if (parts->ge[0] == '{') { + if ((parts->ge = matchchar(parts->ge++, '{', '}'))