Hey!
Can I define an RPm macro that takes a flag that may or may not have an argument?
Aka the behavior should be:
%macro
-> no flag used, assuming user doesn't want the X feature.
%macro -X
-> -X flag used without a value, assuming user wants the X feature, with defaults.
%macro -X foo
-> -X flag used with a value, assuming user wants the X feature, but want's to use "foo instead of the default value for X.
Thanks.
"MH" == Miro Hrončok mhroncok@redhat.com writes:
MH> Hey! Can I define an RPm macro that takes a flag that may or may MH> not have an argument?
As far as I know, you cannot without parsing the argument list yourself. I suggested to upstream RPM that perhaps we could work out a basic (but more flexible) argument parser in Lua and add it to the standard library, but was ridiculed and dismissed.
You also cannot have repeated arguments. (Or rather, you can but only one matters.)
- J<
As far as I know that is not possible, you need a separate xvalue flag…
and then you realise the rpm parser does not do long options, so you need to find another not-self-documenting one letter flag…
and then you realize rpm does not do multi-value flags…
after a while you start designing your macros around magic rpm variables to avoid the rpm arg parser altogether
As others stated, the lua arg parser would be a huge improvments, but rpm devs do not want to hear of it
packaging@lists.fedoraproject.org