> [pmatilai🎩︎lumikko ~]$ rpm --eval '%(date +"%H:%M:%S")'
error: %S: argument expected

This is caused by commit c5909bd8698e56ffa4d1bb380116d61d6b48b8dd, and easily 
worked around with %%S, but this seems dumb as the built-in primitives don't 
take arguments in the non-%{} form at all:

> [pmatilai🎩︎lumikko ~]$ rpm --eval '%S'
error: %S: argument expected
[pmatilai🎩︎lumikko ~]$ rpm --eval '%S:1'
error: %S: argument expected
[pmatilai🎩︎lumikko ~]$ rpm --eval '%{S:1}'
%SOURCE1

It's tempting to let the non-bracketed form fall silently through because it 
cannot take arguments anyway, but then that makes it inconsistent with 
built-ins that do not take arguments, such as %getconfdir. It's kinda tempting 
to require brackets for all built-ins, but then there are %define and friends 
where the bracket form doesn't make any sense (or does strange things).

I suppose a middle ground could be requiring brackets for all the built-ins 
that are expected to expand to some text (ie having builtins->func set), and 
just fall through otherwise.

Thoughts?

(Even more tempting would be axing these IMO silly %S/%P shorthand macros, but 
to my surprise they're so popular that's not really an option.)


-- 
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/1206
_______________________________________________
Rpm-maint mailing list
[email protected]
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to