Re: [Rpm-maint] [rpm-software-management/rpm] implement %elif (#613)

2019-05-20 Thread Panu Matilainen
A lot of related code has changed in the meanwhile and this PR carries an unnecessary amount of historical baggage by now. I'll close this one, @pavlinamv do create a new PR for restarting the %elif work to get a fresh start. -- You are receiving this because you are subscribed to this

Re: [Rpm-maint] [rpm-software-management/rpm] implement %elif (#613)

2019-05-20 Thread Panu Matilainen
Closed #613. -- 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/613#event-2353002024___ Rpm-maint mailing list

Re: [Rpm-maint] [rpm-software-management/rpm] implement %elif (#613)

2019-03-04 Thread Panu Matilainen
This is on hold for now, @pavlinamv has more important assignments at the moment. -- 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 %elif (#613)

2019-03-04 Thread pavlinamv
Thank you for pointing out that this should be rebased. I have a slightly different plan. #625 already contains a non-trivial refactorization, that is useful for %elif. My next step will be to create an additional PR that will contain a correction of a current minor %else parsing problem + as a

Re: [Rpm-maint] [rpm-software-management/rpm] implement %elif (#613)

2019-03-02 Thread ニール・ゴンパ
@pavlinamv #625 was merged, so could you rebase this on top of current git master? -- 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 %elif (#613)

2019-02-19 Thread pavlinamv
I am waiting with a new version of this PR for finishing of PR #625. -- 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 %elif (#613)

2019-02-05 Thread Panu Matilainen
Oh and BTW, a general piece of advise that applies everywhere, including here: when possible, use data structures instead of code logic. -- 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 %elif (#613)

2019-02-05 Thread Panu Matilainen
As mentioned in the warn-after-else PR, one of the things that bugs me here is multiple places to parse the same tokens. Have a function that parses the "line type", which you can then use in both place, maybe borrow a chapter from the macro engine builtins work? The other coding style eyesore

Re: [Rpm-maint] [rpm-software-management/rpm] implement %elif (#613)

2019-02-05 Thread pavlinamv
Reopened #613. -- 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/613#event-2117852085___ Rpm-maint mailing list

Re: [Rpm-maint] [rpm-software-management/rpm] implement %elif (#613)

2019-02-05 Thread pavlinamv
The pull request is reopened (PR #618 will be closed). -- 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 %elif (#613)

2019-01-16 Thread Panu Matilainen
pmatilai commented on this pull request. > spec->readStack = rl; spec->line[0] = '\0'; +} else if (isElif) { + spec->readStack->reading = match && spec->readStack->readable; + if (spec->readStack->reading) + spec->readStack->readable = 0; +

Re: [Rpm-maint] [rpm-software-management/rpm] implement %elif (#613)

2019-01-12 Thread pavlinamv
Corrected version is in PR #618. -- 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/613#issuecomment-453772152___ Rpm-maint mailing

Re: [Rpm-maint] [rpm-software-management/rpm] implement %elif (#613)

2019-01-12 Thread pavlinamv
Closed #613. -- 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/613#event-2070220111___ Rpm-maint mailing list

Re: [Rpm-maint] [rpm-software-management/rpm] implement %elif (#613)

2019-01-12 Thread pavlinamv
pavlinamv commented on this pull request. > spec->readStack = rl; spec->line[0] = '\0'; +} else if (isElif) { + spec->readStack->reading = match && spec->readStack->readable; + if (spec->readStack->reading) + spec->readStack->readable = 0; +

Re: [Rpm-maint] [rpm-software-management/rpm] implement %elif (#613)

2019-01-10 Thread Panu Matilainen
pmatilai commented on this pull request. > spec->readStack = rl; spec->line[0] = '\0'; +} else if (isElif) { + spec->readStack->reading = match && spec->readStack->readable; + if (spec->readStack->reading) + spec->readStack->readable = 0; +

Re: [Rpm-maint] [rpm-software-management/rpm] implement %elif (#613)

2019-01-10 Thread pavlinamv
pavlinamv commented on this pull request. > spec->readStack = rl; spec->line[0] = '\0'; +} else if (isElif) { + spec->readStack->reading = match && spec->readStack->readable; + if (spec->readStack->reading) + spec->readStack->readable = 0; +

Re: [Rpm-maint] [rpm-software-management/rpm] implement %elif (#613)

2019-01-09 Thread pavlinamv
pavlinamv commented on this pull request. > @@ -360,7 +364,10 @@ do { \ int readLine(rpmSpec spec, int strip) { char *s; -int match; +char *z; +int match = 0; +int isIf = 0; +int isElif = 0; Yes a line can be `%if` line, `%elif` line or "another" line. Yes, in some

Re: [Rpm-maint] [rpm-software-management/rpm] implement %elif (#613)

2019-01-09 Thread Panu Matilainen
pmatilai commented on this pull request. > spec->readStack = rl; spec->line[0] = '\0'; +} else if (isElif) { + spec->readStack->reading = match && spec->readStack->readable; + if (spec->readStack->reading) + spec->readStack->readable = 0; +

Re: [Rpm-maint] [rpm-software-management/rpm] implement %elif (#613)

2019-01-09 Thread Panu Matilainen
pmatilai commented on this pull request. > @@ -360,7 +364,10 @@ do { \ int readLine(rpmSpec spec, int strip) { char *s; -int match; +char *z; +int match = 0; +int isIf = 0; +int isElif = 0; A line cannot be both an if and an elif, so there should only really be one

Re: [Rpm-maint] [rpm-software-management/rpm] implement %elif (#613)

2019-01-08 Thread pavlinamv
If this comment is about patch "Move checking whether %if condition will be resolved to the right place" then the reply is: I will improve the commit message. It should not speak about the "right place". But it is not just refactoring because of `%elif`. The current place is not optimal because:

Re: [Rpm-maint] [rpm-software-management/rpm] implement %elif (#613)

2019-01-08 Thread pavlinamv
pavlinamv commented on this pull request. > lbuf = spec->lbuf; SKIPSPACE(lbuf); if (lbuf[0] == '#') isComment = 1; - /* Don't expand macros (eg. %define) in false branch of %if clause */ -if (!spec->readStack->reading) +/* Don't expand macros after %elif

Re: [Rpm-maint] [rpm-software-management/rpm] implement %elif (#613)

2019-01-08 Thread pavlinamv
pavlinamv commented on this pull request. > @@ -421,8 +422,8 @@ int readLine(rpmSpec spec, int strip) match = parseExpressionBoolean(s); if (match < 0) { rpmlog(RPMLOG_ERR, - _("%s:%d: bad %%if condition\n"), -

Re: [Rpm-maint] [rpm-software-management/rpm] implement %elif (#613)

2019-01-07 Thread Panu Matilainen
pmatilai commented on this pull request. How can the current place be "wrong" and the new place "right" if there's no functional change? If it's just refactoring for the next steps, then the commit message should say so. -- You are receiving this because you are subscribed to this thread.

Re: [Rpm-maint] [rpm-software-management/rpm] implement %elif (#613)

2019-01-07 Thread Panu Matilainen
pmatilai commented on this pull request. > @@ -421,8 +422,8 @@ int readLine(rpmSpec spec, int strip) match = parseExpressionBoolean(s); if (match < 0) { rpmlog(RPMLOG_ERR, - _("%s:%d: bad %%if condition\n"), -

Re: [Rpm-maint] [rpm-software-management/rpm] implement %elif (#613)

2019-01-07 Thread Panu Matilainen
pmatilai commented on this pull request. > lbuf = spec->lbuf; SKIPSPACE(lbuf); if (lbuf[0] == '#') isComment = 1; - /* Don't expand macros (eg. %define) in false branch of %if clause */ -if (!spec->readStack->reading) +/* Don't expand macros after %elif

Re: [Rpm-maint] [rpm-software-management/rpm] implement %elif (#613)

2019-01-06 Thread ニール・ゴンパ
Conan-Kudo 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/613#pullrequestreview-189678463___

Re: [Rpm-maint] [rpm-software-management/rpm] implement %elif (#613)

2018-12-19 Thread Panu Matilainen
There's no mechanism for tracking build-side features, we just let things explode. -- 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 %elif (#613)

2018-12-18 Thread ニール・ゴンパ
Won't we need an `rpmlib()` dependency emitted for source packages that have `%elif`? Or do we just typically ignore this and let things explode on their own? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: