Re: [Rpm-maint] [rpm-software-management/rpm] Add %{expr:...} macro for parsing expressions (#817)

2019-08-21 Thread Panu Matilainen
Merged #817 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/817#event-2572929323___ Rpm-maint mailing list

Re: [Rpm-maint] [rpm-software-management/rpm] Add %{expr:...} macro for parsing expressions (#817)

2019-08-21 Thread Panu Matilainen
At the risk of setting precedent that makes users expect friendly error messages from rpm, I'll keep it. It's just a cosmetical thing in any case and can be removed without other risk or harm if it turns out to be overly problematic. -- You are receiving this because you are subscribed to

Re: [Rpm-maint] [rpm-software-management/rpm] Add %{expr:...} macro for parsing expressions (#817)

2019-08-21 Thread Panu Matilainen
Yes, I'm sure you can construct arbitrary cases where it's not going to point to the right place. Making the expression error reports *perfect* is not in the scope of this PR, so either I rip the marker support out or we leave it the way it is. -- You are receiving this because you are

Re: [Rpm-maint] [rpm-software-management/rpm] Add %{expr:...} macro for parsing expressions (#817)

2019-08-21 Thread pavlinamv
It is definitely better. I tried a multiline expression: ``` rpm --eval '%{expr: 0 || 0 || 0 || 0 |o| 0}' ``` and **'^'** does not point to the expected position: ``` +error: syntax error while parsing ||: 0 || 0 || + 0 || 0 |o| 0 +error:

Re: [Rpm-maint] [rpm-software-management/rpm] Add %{expr:...} macro for parsing expressions (#817)

2019-08-21 Thread Panu Matilainen
And now with improved expression error messages in both specs and macros. -- 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 %{expr:...} macro for parsing expressions (#817)

2019-08-21 Thread pavlinamv
> The error messages are simply the same as you get from spec %if conditionals, > there are no messages added / changed in this PR. That's not to say the > messages couldn't maybe be improved, but any change needs to account for the > fact that they're shared between two quite different

Re: [Rpm-maint] [rpm-software-management/rpm] Add %{expr:...} macro for parsing expressions (#817)

2019-08-19 Thread Panu Matilainen
Oh and BTW, the reason for doing this *just now* is that it might be kinda necessary for resolving #804 in the macro space instead of placing all the calculations on the C side. Of course technically Lua could be used for those same calculations but we I don't want to make Lua a hard

Re: [Rpm-maint] [rpm-software-management/rpm] Add %{expr:...} macro for parsing expressions (#817)

2019-08-19 Thread Panu Matilainen
The error messages are simply the same as you get from spec %if conditionals, there are no messages added / changed in this PR. That's not to say the messages couldn't maybe be improved, but any change needs to account for the fact that they're shared between two quite different contexts.

Re: [Rpm-maint] [rpm-software-management/rpm] Add %{expr:...} macro for parsing expressions (#817)

2019-08-19 Thread Panu Matilainen
@pmatilai pushed 1 commit. 22331d303765509f1856352713a8a4de74b1085e Add %{expr:...} macro for parsing expressions -- You are receiving this because you are subscribed to this thread. View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Add %{expr:...} macro for parsing expressions (#817)

2019-08-16 Thread pavlinamv
Functionality is OK, but error messages can be improved. I tried macros: %{expr:0 || b} %{expr:4 &|| 0} %{expr:6 + 9 - o -=iu} in a spec file and error messages were: error: types must match error: syntax error while parsing && error: types must match -- You are receiving this because

Re: [Rpm-maint] [rpm-software-management/rpm] Add %{expr:...} macro for parsing expressions (#817)

2019-08-15 Thread Panu Matilainen
Forgot to update POTFILES.in. Thank you distcheck for catching it early... -- 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] Add %{expr:...} macro for parsing expressions (#817)

2019-08-15 Thread Panu Matilainen
Supports the same expressions as spec %if conditions because, only this returns the result as a string instead of a boolean. This obviously *screams* to be wired into macro conditional syntax, but that's left as an exercise for later. You can view, comment on, or merge this pull request online