Bug 184196 - Unclosed macro in comment causes rpmbuild to fail
Unclosed macro in comment causes rpmbuild to fail
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
All Linux
medium Severity low
: ---
: ---
Assigned To: Paul Nasrat
Mike McLean
Depends On:
  Show dependency treegraph
Reported: 2006-03-06 23:52 EST by Hann-Huei Chiou
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-03-07 11:50:49 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 Hann-Huei Chiou 2006-03-06 23:52:02 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20060202 Fedora/1.7.12-1.5.2

Description of problem:
I was trying to build my own RPM this morning. The spec file
was modified from a known working one. After a little
tweaking, I found that rpmbuild won't execute the %install
stage and wrote the source rpm only.

After a careful inspection, I noticed that a "%{version" was
in the comment (in %build stage). The rest of %build stage
were skipped, so does %install, %pre, %post and %files. Only
the source rpm was written.

I took another official source rpm (tree and kernel) for
testing. Just put a macro without a right brace (# %{name)
in the comment. When rpmbuild saw this, a "+ exit 0" was
executed, thus the rest of the spec file were skipped.

This bug exists on both i386 and x86_64 platforms.

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

How reproducible:

Steps to Reproduce:
1. Install any source rpm
2. Edit the spec file and put "# %{name" in the beginning of the %build stage
3. Execute "rpmbuild -ba XXXX.spec"

Actual Results:  1. rpmbuild skipped the %build stage and the rest of the spec file and wrote
 only the source rpm:
+ exit 0
Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/tree-root
Wrote: /usr/src/redhat/SRPMS/XXXX-A.B.C-D.src.rpm

Expected Results:  binary rpms were successfully built (or failed with messages).

Additional info:

Why does rpmbuild try to parse the comment?
Comment 1 Jeff Johnson 2006-03-07 11:50:49 EST
Macros are expanded everywhere they are found, including comments. Escape
the macro with '%%' is you don't want it expanded.

This is a syntax error, not otherwise.

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