Description of problem: See attached foo.spec for example. Given my understanding of rpm per Maximum RPM, the echo output should be the string "good" but instead I get "bad". Haven't explored to see if this affects more than the %define directive, but I'd guess it does. Version-Release number of selected component (if applicable): rpm-build-4.3.3-8 in fedora-rawhide, but also tested and same behavior from: rpm-build-4.0.4-7x.18 in rh7.3 rpm-build-4.3.2-21 in fc3 How reproducible: always Steps to Reproduce: 1. download attached foo.spec 2. rpmbuild -bp foo.spec Actual results: Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.31889 + umask 022 + cd /usr/src/redhat/BUILD + LANG=C + export LANG + unset DISPLAY + echo bad bad + exit 0 Expected results: as above except "echo good"
Created attachment 109545 [details] minimal specfile to demonstrate bug
Yep. macor expansion is entirely context free, macros are expanded wherever they are found, in comments, within quoted strings, on the false branch of if statements, everywhere. Do # %%define ... to disable the expansion.