Bug 1347865 - systemd spec file needs to escape %prep in comment
Summary: systemd spec file needs to escape %prep in comment
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 25
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL: http://pkgs.fedoraproject.org/cgit/rp...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-06-17 21:26 UTC by Pat Cox
Modified: 2016-08-04 05:07 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-04 05:07:32 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Pat Cox 2016-06-17 21:26:52 UTC
User-Agent:       Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36
Build Identifier: 

The systemd specfile I have is seen here: http://pkgs.fedoraproject.org/cgit/rpms/systemd.git/tree/systemd.spec#n27

rpm (version 4.8.0 on CentOS 6.&) is unable to parse this specfile. See output below.

Reproducible: Always

Steps to Reproduce:
1. download systemd specfile
2. run `rpm -q --qf "%{Name}" --specfile ~/systemd/specfiles/systemd.spec`
Actual Results:  
error: line 217: second %prep
error: query of specfile ~/systemd/specfiles/systemd.spec failed, can't parse

Expected Results:  
systemdsystemd-libssystemd-compat-libssystemd-pamsystemd-develsystemd-udevsystemd-containersystemd-journal-remotesystemd-debuginfo

According to http://www.rpm.org/max-rpm-snapshot/ch-rpm-inside.html, the %prep macro on the comment line needs to be escaped:
"Comments can be placed in any section of the spec file. Note that macros are expanded everywhere, so with multiline macros which would only have the first line commented also escape the percent (%) character:"

Changing '%prep' to '%%prep' on line 27 fixes the parsing.
$ rpm -q --qf "%{Name}" --specfile ~/systemd/specfiles/systemd.spec
systemdsystemd-libssystemd-compat-libssystemd-pamsystemd-develsystemd-udevsystemd-containersystemd-journal-remotesystemd-debuginfo

Comment 1 Jan Kurik 2016-07-26 05:06:54 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 25 development cycle.
Changing version to '25'.

Comment 2 Zbigniew Jędrzejewski-Szmek 2016-08-04 05:07:32 UTC
Fixed in edb4e050132b3c8d7764b73d0d7dc564aba51d8f.


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