Bug 184196 - Unclosed macro in comment causes rpmbuild to fail
Summary: Unclosed macro in comment causes rpmbuild to fail
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 4
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
Assignee: Paul Nasrat
QA Contact: Mike McLean
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-03-07 04:52 UTC by Hann-Huei Chiou
Modified: 2025-01-27 10:02 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2006-03-07 16:50:49 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Hann-Huei Chiou 2006-03-07 04:52:02 UTC
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):
rpm-build-4.4.1-22

How reproducible:
Always

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 16:50:49 UTC
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.

Comment 2 Sabrina Lynch 2024-06-12 08:53:46 UTC Comment hidden (spam)
Comment 3 danisa 2024-12-16 02:15:42 UTC Comment hidden (spam)

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