[Rpm-maint] [rpm-software-management/rpm] Remove %ifarch-%endif from %debug_package macro (#635)

pavlinamv notifications at github.com
Thu Feb 28 12:55:07 UTC 2019


> Err, what? You trimmed out the relevant part of that quote:

>>    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.

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 :
```
%mymacro0 \
%if 0  \
%global bbb0 ccc0 \
%endif \
%{nil}

%mymacro1 \
%if 1  \
%global bbb1 ccc1 \
%endif \
%{nil}
```
then add into "tests/data/SPECS/replacetest.spec"
after the "%install" line two echos:
```
echo %mymacro0
echo %mymacro1
```
and change the line:
```
echo "%{filedata}" > $RPM_BUILD_ROOT/opt/foo
```
to the line:
```
 echo "%bbb0 --- %bbb1 --- %name --- %ohouhiuiu" > $RPM_BUILD_ROOT/opt/foo
```
run "make check". Then you can see that
```
%bbb0 --- %bbb1 --- %name --- %ohouhiuiu
```
was expanded into
```
ccc0 --- ccc1 --- replacetest --- %ohouhiuiu
```
you can check it in tests/rpmtests.dir/232/rpmtests.log.

-- 
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/issues/635#issuecomment-468262215
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20190228/2cdedb55/attachment.html>


More information about the Rpm-maint mailing list