[Rpm-maint] [rpm-software-management/rpm] Support new %[ ] expression expansion syntax (#846)

Panu Matilainen notifications at github.com
Fri Sep 20 13:46:38 UTC 2019


Not sure that message makes it any clearer, I probably failed to explain why I find it confusing to begin with. I guess the problem is that it doesn't explain *why* it expects an integer there, and that makes it sound like it will *only* accept a number there, which in a macro context seems baffling to a macro veteran:
```

$ ./rpm --define "aaa a" --define "bbb b" --eval '%[ 1 < 0 ? %aaa : %bbb ]'
error: macro expansion did not return a number:  1 < 0 ? %aaa : %bbb
error:                                                          ^
error: expanded string: b
```

It seems pretty mysterious (*what do you mean a number, what is this lucky seven it's asking for, macros deal with text!*) until you realize that it should be quoted to be considered a string, or a plain integer. As quotes haven't been prominent in the macro space, I doubt I'll be the only one puzzling over that.

That said, I don't have any concrete suggestion for a message offhand, lets sleep over the weekend to see if we can come up with something better. At any rate it I think should talk about an integer instead of a number as only integers are accepted.

-- 
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/846#issuecomment-533560504
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20190920/caf4a765/attachment-0001.html>


More information about the Rpm-maint mailing list