Re: [Rpm-maint] [rpm-software-management/rpm] Remove TOK_IDENTIFIER support from expression parsing (#840)

2019-09-17 Thread Michael Schroeder
I was about to write that this still works, but it really depends on to what `%var` expands. It'll most likely be an error and you need to write `%if "%var" != "string"`. -- 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] Remove TOK_IDENTIFIER support from expression parsing (#840)

2019-09-17 Thread ニール・ゴンパ
@mlschroe Wait, even *I* use `%if %var != "string"`... That won't work anymore? -- 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] expression expansion (#834)

2019-09-17 Thread Michael Schroeder
Ok, I'll create a pull request tomorrow. Is it ok to add a `flags` argument to rpmExprBool()/rpmExprStr() or is the API fixed and we need new functions? I'm asking because they are in rpm-4.15.x and you probably don't want to cherry pick this into 4.15? The flags would be

Re: [Rpm-maint] [rpm-software-management/rpm] Remove TOK_IDENTIFIER support from expression parsing (#840)

2019-09-17 Thread Michael Schroeder
The problem is that many people do not know that `%var != string` is not valid syntax. Even Panu used `a!=b` in the test suite. I prefer ripping out the code because the currently only `[a-zA-Z][a-zA-Z0-9]*` is supported (it's supposed to match an identifier, but note the missing `_`) and thus

Re: [Rpm-maint] [rpm-software-management/rpm] Localize our chroot in/out operations to minimize time spent inside (#836)

2019-09-17 Thread ニール・ゴンパ
@pmatilai Is this something you want to also include for rpm 4.15? -- 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 'string' into query format extensions in man-pages (#837)

2019-09-17 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/837#pullrequestreview-289278320___

Re: [Rpm-maint] [rpm-software-management/rpm] Remove TOK_IDENTIFIER support from expression parsing (#840)

2019-09-17 Thread ニール・ゴンパ
Conan-Kudo approved this pull request. I guess if no one noticed for ~19 years... -- 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] Print an error for expressions with missing operands (#841)

2019-09-17 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/841#pullrequestreview-289276563___

Re: [Rpm-maint] [rpm-software-management/rpm] Add ternary operator support to expression parser (#838)

2019-09-17 Thread Michael Schroeder
I've opened another pull request that fixes the error printing as this is unrelated to the ternary operator. -- 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] Print an error for expressions with missing operands (#841)

2019-09-17 Thread Michael Schroeder
Expressions like 5 + did not print an error message before. You can view, comment on, or merge this pull request online at: https://github.com/rpm-software-management/rpm/pull/841 -- Commit Summary -- * Print an error for expressions with missing operands -- File Changes -- M

[Rpm-maint] [rpm-software-management/rpm] Remove TOK_IDENTIFIER support from expression parsing (#840)

2019-09-17 Thread Michael Schroeder
Identifier expansion got broken in 2000 when getMacroBody() was removed from the API (commit ad99fcba52fcc5e8ab636d2f1760c945cdfbf19). Nobody seemed to have noticied, so its safe to say that there is no one that used it the intented way. With the bad commit there is an unintended use for it: it

Re: [Rpm-maint] [rpm-software-management/rpm] Add ternary operator support to expression parser (#838)

2019-09-17 Thread Michael Schroeder
I modeled the code after the other operators. Things like `--eval '%{expr: 4 +}'` have the same 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] Add 'string' into query format extensions in man-pages (#837)

2019-09-17 Thread pavlinamv
Yes, there is no need to use ":string". But it is supported. -- 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 ternary operator support to expression parser (#838)

2019-09-17 Thread pavlinamv
I think that adding ternary operator support to the expression parser is useful and it will not cause problems in the parsing of the existing expressions. There is one thing that can be improved -cases like: ``` --eval '%{expr: 1 ?}' --eval '%{expr: 0 ? 3 : }' ``` returns an error, but

[Rpm-maint] [rpm-software-management/rpm] Drop slen from builtin macro parser function (#839)

2019-09-17 Thread Michael Schroeder
The calculation of the slen parameter was not correct, as it didnt account for already processed characters. The parameter itself was also not used to limit the passed string, as the code assumed zero termination. Thus we can as well simplify the code by using strlen() on the passed string. You

Re: [Rpm-maint] [rpm-software-management/rpm] Add 'string' into query format extensions in man-pages (#837)

2019-09-17 Thread Panu Matilainen
Might want to note that this is also the default format, so using it is generally redundant. -- 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] expression expansion (#834)

2019-09-17 Thread Panu Matilainen
Yeah, %[] is nice. -- 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/834#issuecomment-532075022___ Rpm-maint mailing list