Bug 74949 - %foo substitutions occur in .spec file comments; multiline %foo breaks out of a comment
%foo substitutions occur in .spec file comments; multiline %foo breaks out of...
Product: Red Hat Linux
Classification: Retired
Component: redhat-rpm-config (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Elliot Lee
Depends On:
  Show dependency treegraph
Reported: 2002-10-02 20:40 EDT by D. Hugh Redelmeier
Modified: 2008-05-01 11:38 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-01-13 14:17:41 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description D. Hugh Redelmeier 2002-10-02 20:40:34 EDT
Description of Problem:

A spec file that has worked for years does not work on RHL8.0.
The reason appears to be that rpmbuild looks inside comments and gets confused.
In particular, the following comment in the %install section caused
the rpmbuild to fail.
# This can be different from JOVEHOME for %build's make.
If I change the ' to _, the rpmbuild succeeds!

Version-Release number of selected component (if applicable):

How Reproducible:

Steps to Reproduce:
1. wget -N ftp://ftp.cs.utoronto.ca/pub/hugh/jove-dev/jove4.16.0.56.tgz
2. rpmbuild -ta jove4.16.0.56.tgz

Actual Results:
fails because it treats a large part of the script as if it
were a single file name!?!  The name starts with "'s make.".
The error message is "No such file or directory".

Expected Results:
successful build (with warning about two files not being packaged)

Additional Information:
It is possible that the %build in the comment is part of the problem.
Comment 1 Jeff Johnson 2002-11-16 15:04:40 EST

However, watchout for redhat-rpm-config,
which, if installed, may be overloading %build.

Yes %foo tokens are expanded everywhere, including comments
and within single and double quoted strings.
Comment 2 D. Hugh Redelmeier 2003-01-13 13:38:33 EST
My problem was that %build was expanded inside a comment, and expanded to a
multi-line thing, so it "broke out" of the comment.

This is a really bad/surprising feature.  I guess I should read the
documentation.  Oh, there is none that is current.  Oh well :-)

This needs to be documented or fixed.
Comment 3 Elliot Lee 2003-01-13 14:17:41 EST
It is as well documented as any other part of RPM (as in, not really at all).

Macros have to be expanded everywhere in order for many aspects of spec files to work, 
so this can't really be changed (rpm has no concept of comment lines at macro expansion 

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