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:
@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:
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
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
@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:
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___
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:
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___
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:
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
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
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:
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:
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
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
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:
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
17 matches
Mail list logo