[Rpm-maint] [rpm-software-management/rpm] Implement %dnl (discard to next line) macro primitive for comment use (#753)

Panu Matilainen notifications at github.com
Tue Jun 18 10:26:15 UTC 2019


There has been no way to add comments to multiline macros, and while
spec files technically support #-commenting at beginning of lines, it
does not apply to all sections and causes generation after generation
of packagers to stumble on the same items over and over: macros
are expanded within spec comment lines, which makes commenting multiline
macros such as %configure annoying, comments inteded for scriptlets
end up being in the previous scriptlets body, and numerous other quirks.

This implements the M4-inspired %dnl macro primitive which literally
discards everything until the next newline (or end of string), without
expanding the contents. This allows comments to be used inside multiline
macros and everywhere in spec.

Caveat: in some places such as %description the newline doesn't actually
get discarded but this is a a spec parser issue, not on the macro side.

Closes: #158
You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/753

-- Commit Summary --

  * Implement %dnl (discard to next line) macro primitive for comment use

-- File Changes --

    M doc/manual/macros (1)
    M rpmio/macro.c (9)
    M tests/data/macros.testfile (10)
    M tests/rpmmacro.at (18)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/753.patch
https://github.com/rpm-software-management/rpm/pull/753.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/753
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20190618/c755fb6f/attachment.html>


More information about the Rpm-maint mailing list