Hide Forgot
From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.14) Gecko/20080416 Fedora/2.0.0.14-1.fc8 Firefox/2.0.0.14 Description of problem: rpm spec files ignore # if it precedes %define In the followimg example, we see echo of 222 instead of 111 [antony@linuxlaptop1 ~]$ cat foo.spec %define aaa 111 #%define aaa 222 Name: foo Version: 1.0 Release: 5 License: Xyz Group: System/Application Summary: test bug of commenting defines %prep echo %{aaa} %description test bug of commenting defines [antony@linuxlaptop1 ~]$ rpmbuild -bb -v foo.spec Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.12193 + umask 022 + cd /usr/src/redhat/BUILD + echo 222 222 + exit 0 Checking for unpackaged file(s): /usr/lib/rpm/check-files %{buildroot} Version-Release number of selected component (if applicable): rpm-build-4.4.2.2 How reproducible: Always Steps to Reproduce: 1.copy the spec file above from the description 2.run the rpmbuild command 3.see 222 echoed instead of the expected 111 Actual Results: echoes 222 Expected Results: see 111 Additional info:
rpmdevtools has no chance to affect this, reassigning to rpm.
This has always been the case: %define is a macro and macros are expanded everywhere, comments included and you need to use %%define to escape. Not a bug, but "intended behavior". That said, the behavior has been criticized a lot and I don't disagree at all, the rules for spec comments are clear as mud because % is overloaded to mean section markers, macros and various other items like %config(...) attributes, "internal" macros like %patch are behave differently from "real" macros etc. The problem is, really sorting out the mess would require incompatible changes to the spec "syntax". The behavior is not going to change for Fedora 8 (hence WONTFIX), if you want to discuss it further feel free to open a ticket at rpm.org.