Bug 1249693

Summary: rpmbuild returns a bad error message
Product: [Fedora] Fedora Reporter: Viktor Jancik <vjancik>
Component: rpmAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: bugs.michael, ffesti, hhorak, jzeleny, kevin, lkardos, novyjindrich, packaging-team-maint, pknirsch, twoerner
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-08-05 09:39:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Viktor Jancik 2015-08-03 15:05:39 UTC
Description of problem:
My spec file had a line:
    %config{noreplace} %{_sysconfdir}/wgetrc

and the error returned by RPM build was:
    File must begin with "/": {noreplace}

when the real error is bad brackets on %config(noreplace).


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

How reproducible:
Always

Steps to Reproduce:
1.Write a spec file with %config{noreplace} in it
2.Try to build the package

Actual results:
RPM build errors:
    File must begin with "/": {noreplace}

Expected results:
RPM build errors:
    Wrong brackets, curly instead of normal: %config{noreplace}
~or something like that

Additional info:

Comment 1 Kevin Fenzi 2015-08-03 15:33:35 UTC
rpmbuild is made from the rpm source package... ;) 

Moving over there for comment...

Comment 2 Florian Festi 2015-08-05 09:39:45 UTC
Sorry, rpmbuild is not going to guess your intentions and then try to give helpful hints. The error message is gives is quite correct. Rpmbuild expects a file name and complains that it is malformed. The "(noreplace)" part is optional and the spec parser has correctly decided that it is not there.

The error message also is not misleading. It tells you quite directly which part it is not able to interpret in a useful way and what it thinks should be there.