Bug 144642 - rpmbuild still parses %defines which are commented with # in specfile
rpmbuild still parses %defines which are commented with # in specfile
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
Mike McLean
Depends On:
  Show dependency treegraph
Reported: 2005-01-10 02:39 EST by Ellen Shull
Modified: 2007-11-30 17:10 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-01-10 10:43:25 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
minimal specfile to demonstrate bug (258 bytes, text/plain)
2005-01-10 02:39 EST, Ellen Shull
no flags Details

  None (edit)
Description Ellen Shull 2005-01-10 02:39:13 EST
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:

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
+ export LANG
+ unset DISPLAY
+ echo bad
+ exit 0

Expected results:
as above except "echo good"
Comment 1 Ellen Shull 2005-01-10 02:39:14 EST
Created attachment 109545 [details]
minimal specfile to demonstrate bug
Comment 2 Jeff Johnson 2005-01-10 10:43:25 EST
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.

   # %%define ...
to disable the expansion.

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