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
define(name, body)
documentation does not align with implementation
#2962
Comments
IOW this is what the heading says:
but this is how it actually works:
|
define(name, body)
documentation is incorrectdefine(name, body)
documentation does not align with implementation
It's kinda sad that this strips the leading spaces:
|
Indeed, rpm.define() calls rpmDefineMacro() which is takes the macro name and the body as a single line - as you would get in a macro file. It doesn't make much sense as an API. IIRC Lua's rpm.define() used that API because the other alternative lacked all the error checking back in the day, but things are quite different now, rpm.define() should just reroute to macros.define or something. Note that this also works: |
For the context, I have stumbled upon this issue playing with #2969 and my initial idea was to assign the whole macro body including the new lines to some macro with some specifically crafted name. But I was not able to achieve that no matter what and resorted to use variables (which is probably good enough variant). It is my feeling that for whatever reason defining macro in Lua is limited comparing to plain .spec file, not being able to insert new line there. But maybe I have just not figured out the right amount of backslashes or what not. |
This line is incorrect IMHO:
rpm/docs/manual/lua.md
Line 120 in 689f1d8
It should actually be something like
define(name_body)
. This example actually seems to be correct:rpm/docs/manual/lua.md
Line 128 in 689f1d8
But in any case, it would make more sense if the heading was correct and the
define
method supported thename
andbody
arguments. Why it does not work like this?The text was updated successfully, but these errors were encountered: