Bug 152136 - %configure in .spec file cannot be commented out
Summary: %configure in .spec file cannot be commented out
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm   
(Show other bugs)
Version: 3
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Paul Nasrat
QA Contact: Mike McLean
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-03-25 06:40 UTC by Aaron VanDevender
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-03-26 14:23:19 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description Aaron VanDevender 2005-03-25 06:40:25 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050302 Firefox/1.0.1 Fedora/1.0.1-1.3.2

Description of problem:
I wrote a spec file which didn't need a ./configure run in the %build section, and so I commented out the %configure line like this:

# %configure

However, which I build the package using rpmbuild, it still tries to run configure, which of course throws an error:

/var/tmp/rpm-tmp.77728: line 36: ./configure: No such file or directory

However if I just delete the # %configure line (rather than just comment it out) it build normally.

Version-Release number of selected component (if applicable):
rpm-build-4.3.2-21

How reproducible:
Always

Steps to Reproduce:
1. build a spec file
2. comment out the %configure line
3. run rpmbuild

Actual Results:  the rpmbuild fails with "./configure: No such file or directory"

Expected Results:  rpmbuild should not have attempted to run ./configure, and should have completed without error.

Additional info:

Comment 1 Jeff Johnson 2005-03-26 14:23:19 UTC
Comment out by doubling the % character, as in
    # %%configure

Comment 2 Aaron VanDevender 2005-03-26 14:57:56 UTC
How is this NOTABUG? What little documentation is available for the rpm spec
file says using an octothorp (#) in front of a line should make it ignored.

http://www.rpm.org/max-rpm/ch-rpm-specref.html

This doesn't happen. The documentation says nothing about "except if its a
%configure then you have to add an octothorp and an extra percent sign." This
clearly ISABUG.

Comment 3 Paul Nasrat 2005-03-30 13:00:17 UTC
Macros are expanded everywhere, so multiline macros such as configure only get a
comment on the first line.  The documentation fails to make that clear

http://www.redhat.com/archives/rpm-list/2003-April/msg00075.html

See

http://www.rpm.org/max-rpm-snapshot/ch-rpm-specref.html for updated
documentation - to see for yourself:

rpm -E '#%configure'
rpm -E '#%__tar'


Comment 4 Aaron VanDevender 2005-03-30 15:57:28 UTC
Why don't we just have the macro processor ignore commented lines as well? Seems
like that would be simpler than having to remember if a macro was multiline or
not. It would also prevent things mysteriously breaking if a macro got changed
from a single line to a multiline. It's the DWIMy thing to do. Do we gain
anything by expanding macros in comments?

Comment 5 James Olin Oden 2005-03-30 16:08:49 UTC
The problem is that what defines a comment in the scriptlets?  Though most, as 
its the default use /bin/sh as their scriptlet interpretter, you can specify an 
alternate interpretter.  # is not a comment in all scripting languages (many 
but not all).  So yes, at least within scriptlets there is something to be 
gained by expanding macros after a #.  This, BTW, is very simular to how the m4 
macro processor works.

Cheers...james


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