Bug 443775 - Cannot comment out macro definitions
Cannot comment out macro definitions
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Panu Matilainen
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2008-04-23 05:13 EDT by Stefan Ring
Modified: 2008-04-24 04:09 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-04-23 05:58:09 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Test .spec file (360 bytes, text/plain)
2008-04-23 05:15 EDT, Stefan Ring
no flags Details

  None (edit)
Description Stefan Ring 2008-04-23 05:13:05 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):

How reproducible:
Use the attached .spec file

Steps to Reproduce:
1. Use rpmbuild -bc on the .spec file
Actual results:
+ echo 'Should be empty: but it is not'

Expected results:
+ echo 'Should be empty: '

Additional info:
Very nasty...
Comment 1 Stefan Ring 2008-04-23 05:15:09 EDT
Created attachment 303461 [details]
Test .spec file

Where did my attachment go...?
Comment 2 Panu Matilainen 2008-04-23 05:58:09 EDT
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.
Comment 3 Stefan Ring 2008-04-24 04:04:51 EDT
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.
Comment 4 Stefan Ring 2008-04-24 04:09:42 EDT
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... ;)

Note You need to log in before you can comment on or make changes to this bug.