Re: [Rpm-maint] [rpm-software-management/rpm] expression expansion (#834)

2019-09-23 Thread Michael Schroeder
Closed #834. -- 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#event-2654226267___ Rpm-maint mailing list

Re: [Rpm-maint] [rpm-software-management/rpm] expression expansion (#834)

2019-09-18 Thread Panu Matilainen
Hmm. It's on the subtle side, and such things aren't the easiest to communicate to the packager community at large. But lets see... -- 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-18 Thread Michael Schroeder
No, don't drop it. It's still useful if you need to do expansion before calling the expression parser. I.e. you have either 'expand first, then don't expand in the expression parser' or 'expand in the expression parser': ``` %define test 1 + 2 %{expr:%test} # the next line expands twice!

Re: [Rpm-maint] [rpm-software-management/rpm] expression expansion (#834)

2019-09-18 Thread Panu Matilainen
Note that if we add %[] for expressions then I think we should drop %{expr:...} entirely, it hardly serves any purpose then. -- 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-18 Thread Panu Matilainen
I'm thinking that with these new developments, we'd better revert %{expr:..} entirely from 4.15, we don't want people adopting it if the behavior is just about to change. Pulling it into 4.15 felt a bit hasty anyway, apparently for a good reason. Along with that change I think we can sneak in

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] 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

Re: [Rpm-maint] [rpm-software-management/rpm] expression expansion (#834)

2019-09-16 Thread pavlinamv
@mlschroe: I like this idea. I checked Fedora spec files and there was no conflict with "%[... ]". -- 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-16 Thread Michael Schroeder
How about using `%[ ]` for expression expansion? We'd have: `%{ ... }`: macro expansion `%( ... )`: shell expansion `%[ ... ]`: expression expansions I did a grep over SUSE's spec files and there was no conflict. Could someone please do this for Fedora as well? -- You are receiving this

Re: [Rpm-maint] [rpm-software-management/rpm] expression expansion (#834)

2019-09-13 Thread Michael Schroeder
Here's my proposal: 1) turn off default string expansion in rdToken This is an incompatible change, but it's clearly the right thing and I can't imaging somebody actually using this in a %if statement 2) Add optional expansion for the integer case 3) Add a new macro that does not

[Rpm-maint] [rpm-software-management/rpm] expression expansion (#834)

2019-09-11 Thread Michael Schroeder
There's a lot of expansion going on in the %expr macro. Witness this: ./rpm --eval '%{expr: ""}' % The string gets expanded - at the start of doFoo when it expands the argument - in rdToken when it parses a string - at the end of doFoo because of issue #313 I'm somewhat surprised that