[Rpm-maint] [rpm-software-management/rpm] Warn if a text is after %else or %endif (#625)
pavlinamv
notifications at github.com
Fri Feb 8 12:37:11 UTC 2019
> %if-%else-%endif is a spec-only construct, there's no support for them in the actual macro engine. Macro files are purely declarative and doesn't support any sort of conditionals. You can of course define a macro that contains and %if-%else-%endif but that will only work as expected when expanded in a spec.
Please where is it documented? I am asking because there are macro files, that contain %if. For example:
/usr/lib/rpm/macros.d/macros
/usr/lib/rpm/macros.d/macros.lua
/usr/lib/rpm/macros.d/macros.cmake
/usr/lib/rpm/macros.d/macros.selinux-policy
> I'm thinking the only sane interpretation would be that only the opening %if can appear from a macro expanded on that line.
Please can you explain why? In this case there is still a problem with detecting %else and %endif lines too? What %if's that are expanded from an already expanded macro?
>So maybe it's just me, but this completely failed to drive the point across. "expanded according to evaluation" basically reads to me that "expansion depends on the evaluation" which makes me think "so, it's an %if, what do you expect?" Adding something like "contrary to expectations" would help make it more obvious what the problem is.
>Which is just to say that concrete tends to work better than abstract in commit messages and the like. Maybe something to the tune of "contrary to expectations, the entire %else line is considered to be a part of the preceeding %if block", and with a concrete example of what actually happens.
I will improve the commit message.
--
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/625#issuecomment-461789707
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20190208/4a4aa17b/attachment.html>
More information about the Rpm-maint
mailing list