[Rpm-maint] [rpm-software-management/rpm] Test a macro from a macro file that contains %ifxxx - %endif (#640)
pavlinamv
notifications at github.com
Mon Mar 4 09:53:25 UTC 2019
The underlying problem tested in the patch:
If a macro is in a macro file and at the same time it contains
%ifxxx - %endif (%ifxxx here denotes one of %if, %ifarch, %ifnarch,
%ifos, %ifnos) then during the rpm expansion of the macro the lines
inside %ifxxx - %endif are expanded in all cases (no matter whether
the condition after %ifxxx is satisfied or not).
Thus e.g. if the following definition is in a macro file:
%mymacro \
%if 0 \
%global bbb ccc \
%endif \
%{nil}
and a spec file contains line:
%mymacro
then during the expansion of %mymacro macro %bbb is globally
defined even if the condition after %if is not true.
It is not a problem in evaluation of the %if condition. It is caused
by the fact that the whole %mymacro is expanded in several recursive
steps and in meantime there is no check whether some of its lines start
by %ifxxx.
You can view, comment on, or merge this pull request online at:
https://github.com/rpm-software-management/rpm/pull/640
-- Commit Summary --
* Test a macro from a macro file that contains %ifxxx - %endif
-- File Changes --
M tests/Makefile.am (2)
A tests/data/SPECS/iftest.spec (20)
A tests/data/macros.iftest (13)
M tests/rpmmacro.at (19)
-- Patch Links --
https://github.com/rpm-software-management/rpm/pull/640.patch
https://github.com/rpm-software-management/rpm/pull/640.diff
--
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/640
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20190304/7942d6f4/attachment.html>
More information about the Rpm-maint
mailing list