Bug 18010

Summary: %{ } expands in comment
Product: [Retired] Red Hat Linux Reporter: Han-Wen Nienhuys <hanwen>
Component: rpm-buildAssignee: Jeff Johnson <jbj>
Status: CLOSED WONTFIX QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: 7.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-10-02 07:33:41 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:

Description Han-Wen Nienhuys 2000-10-01 10:24:34 UTC
%{ } macros in spec files are expanded in comments. This gives unexpected
effects if the substitution text has multiple lines (like %{_configure}

Comment 1 Nalin Dahyabhai 2000-10-02 05:31:13 UTC
I'd think this is the expected behavior, in case macro expansions are needed in
the comments, though it's seldom used.  Does escaping the macro name using the
form "%%{macro_name}" not give the desired text?

Comment 2 Han-Wen Nienhuys 2000-10-02 07:33:39 UTC
A .spec line like

# %{_configure} doesn't work

will expand to

# [goobledygook]
[more blah] doesn't work

and this will yield a error message from sh ("EOF found while looking for `''"),
which is at first sight entirely unrelated to the  .spec file.  

The content of comments should be ignored, and expanding in a comment should
have no effect, by definition, as far as I'm concerned. Either that or, all %{}
macros should be on a single line.

If this is a useful feature, then I'm little red ridinghood.



Comment 3 Jeff Johnson 2000-10-03 17:12:54 UTC
And I'm the Big Bad Wolf :-)

Add the extra % ...

Comment 4 rhaig 2000-10-03 20:14:05 UTC
I'm sure the workaround you've mentioned will work, but doesn't it seem odd to 
not ignore the comments?  perhaps rather than being marked resolved, this should
be changed to an enhancement req, marked low priority, and shuffled to the
bottom of the pile??