Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macro documentation does not mention {body} syntax for macro definitions #2976

Open
mlschroe opened this issue Mar 15, 2024 · 4 comments
Open

Comments

@mlschroe
Copy link
Contributor

I noticed that there is no documentation for this construct

$ rpm --define 'foo { bar }' --eval '>%{foo}<'
> bar <

Should we document it? Or is that feature deprecated? Does anybody use it at all?

@dmnks dmnks self-assigned this Mar 20, 2024
@dmnks
Copy link
Contributor

dmnks commented Mar 26, 2024

Relevant piece of code:

} else if (c == '{') { /* XXX permit silent {...} grouping */

@pmatilai
Copy link
Member

pmatilai commented Mar 28, 2024

I certainly remember seeing that code, but never quite got what it actually refers to. I doubt anybody knows of it, really.

It'd be a lot more useful if it permitted multiline macros. People seem to be widely abusing %{expand:...} (probably without fully realizing the consequences) to get the more function-like block syntax for multiline macros instead of \-line continuations.

@mlschroe
Copy link
Contributor Author

mlschroe commented Apr 2, 2024

The code in doDefine() supports multiline macros, it's that nasty rdcl() function that is to blame here.

@mlschroe
Copy link
Contributor Author

mlschroe commented Apr 2, 2024

I think the original intend was to make the macro definitions look like bash function definitions.

@dmnks dmnks removed their assignment Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

3 participants