This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 152136 - %configure in .spec file cannot be commented out
%configure in .spec file cannot be commented out
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
3
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Paul Nasrat
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-03-25 01:40 EST by Aaron VanDevender
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

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


Attachments (Terms of Use)

  None (edit)
Description Aaron VanDevender 2005-03-25 01:40:25 EST
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 09:23:19 EST
Comment out by doubling the % character, as in
    # %%configure
Comment 2 Aaron VanDevender 2005-03-26 09:57:56 EST
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 08:00:17 EST
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 10:57:28 EST
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 11:08:49 EST
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.