Bug 144642

Summary: rpmbuild still parses %defines which are commented with # in specfile
Product: [Fedora] Fedora Reporter: Ellen Shull <ellenshull>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED WONTFIX QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: nobody+pnasrat
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-01-10 15:43:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
minimal specfile to demonstrate bug none

Description Ellen Shull 2005-01-10 07:39:13 UTC
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"

Comment 1 Ellen Shull 2005-01-10 07:39:14 UTC
Created attachment 109545 [details]
minimal specfile to demonstrate bug

Comment 2 Jeff Johnson 2005-01-10 15:43:25 UTC
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.