Red Hat Bugzilla – Bug 443775
Cannot comment out macro definitions
Last modified: 2008-04-24 04:09:42 EDT
Description of problem:
The RPM guide says: Any line starting with a hash character, #, holds a comment. RPM will ignore
Unfortunately, this is not the case.
Version-Release number of selected component (if applicable):
Use the attached .spec file
Steps to Reproduce:
1. Use rpmbuild -bc on the .spec file
+ echo 'Should be empty: but it is not'
+ echo 'Should be empty: '
Created attachment 303461 [details]
Test .spec file
Where did my attachment go...?
Yup, macros are expanded even in comments. This is fairly well known and
intended behavior, documented in RPM Guide and various other places. Quote from
Avoid single percent signs, %, in comments. For example:
# Added new commands to %prep
The rpmbuild command may report an error of a second %prep section. To get
around this problem, use two percent signs, such as %%prep, in spec file comments.
Ok thanks for the clarification. It's not a very "discoverable" feature, I would
Apparently that's the reason I haven't understood rpm macros for years - every
attempt at playing around with them failed completely and utterly because I
commented out something (or so I thought), and it didn't have any effect.
Maybe vim and emacs syntax coloring rules should be changed for spec files. I
tend to rely on the visual feedback for such mundane tasks.
PS Sorry for the spam but somehow pressing a submit button always results in a
flurry of new thoughts... ;)