Commit 153034e
committed
Fix COPR mock build: strip percent-signs from spec-file comments
v0.1.6's COPR build failed in mock (all 10 chroots) with:
warning: Macro expanded in comment on line 5: %install lays
error: Name field must be present in package: (main package)
Root cause: RPM specs do NOT treat `#` as escaping `%`. The macro
processor runs before the comment processor, so a `%macro` token
inside a comment gets expanded just like one in a directive. Two
comments in packaging/qn-bin.spec mentioned `%prep` and `%install`
to describe what those sections do. When RPM hit the `%install` in
line 5's comment it expanded it, corrupting the parser's preamble
state, and by the time RPM reached `Name: qn` on line 15 it had
lost context and emitted the misleading "Name field must be
present" error.
Fix: remove all `%`-prefixed macro mentions from comments and add a
note (without a `%` symbol) reminding future editors that the
character is unsafe in spec comments.
Belt-and-suspenders: every comment line in the spec is now grep-clean
of `%` entirely (`grep -nE '^#.*%' qn-bin.spec` → no matches), so any
future edit that accidentally reintroduces `%foo` in a comment gets
caught by a one-line lint.
This fix is forward-only: v0.1.6 already shipped to crates.io, GHCR,
.deb, and the GitHub Release. v0.1.7 will exercise the corrected COPR
spec and backfill COPR for the recent versions.1 parent bd1b3db commit 153034e
1 file changed
Lines changed: 12 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
9 | 15 | | |
10 | 16 | | |
11 | 17 | | |
| |||
19 | 25 | | |
20 | 26 | | |
21 | 27 | | |
22 | | - | |
23 | | - | |
| 28 | + | |
| 29 | + | |
24 | 30 | | |
25 | 31 | | |
26 | 32 | | |
| |||
0 commit comments