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
Remove %ifarch-%endif from %debug_package macro #635
Comments
Err, what? You trimmed out the relevant part of that quote:
That macro is part of automated debuginfo generation and is only ever invoked in spec context, where %if is perfectly fine. That macro snippet is there to avoid debuginfo generation on noarch packages. |
The problem is more complicated. Macro written in a macro file that contains %if-%else-%endif + %global inside will not work correctly even if it is expanded in spec file. For example use rpm sources and add into macro.in file :
then add into "tests/data/SPECS/replacetest.spec"
and change the line:
to the line:
run "make check". Then you can see that
was expanded into
you can check it in tests/rpmtests.dir/232/rpmtests.log. |
That's one helluva convoluted reproducer, hard to see the point in there. Shortened it a bit, execute rpmbuild -bp to see :
But true, those %globals are "executed", and come to think of what happens during the macro expansion, of course they are. Yet the %ifnarch -test in %debug_package does work as intended, so there's some non-obvious interaction there. Still, that macro does not need any fixing because it does what's is supposed to, feel free to try it out if you dont believe me. |
In PR #625 Comment 6 Panu wrote:
"%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."
In maco file macros.in there is macro
that contains %ifnarch and thus it should be corrected.
Currently after expanding of macro %debug_package (e.g. in some spec file) global definition
is expanded in all cases.
The text was updated successfully, but these errors were encountered: