[Rpm-maint] [rpm-software-management/rpm] Add support for defining literal macros via a new modifier syntax (PR #4129)

Panu Matilainen notifications at github.com
Tue Mar 24 10:01:44 UTC 2026


@pmatilai commented on this pull request.



> @@ -738,6 +748,19 @@ Expands to *1* if *%aa* expands to *5*, otherwise expands to *2*:
 %[ "%{aa}" == "5" ? 1 : 2]
 ```
 
+## Example 7. Literal macros
+
+Define a macro whose body contains literal *%* characters, possibly
+overlapping with other macros:
+
+```
+%mymacro 1.2.3
+%aa %mymacro
+%bb<l> %mymacro

The thing is, for most `my%thing` random strings with a percent sign, literal makes no difference whatsoever just because there's no overlapping macro that would get expanded. To demonstrate the effect it has, you kinda need another macro that overlaps. 

Hmm okay, then there's also `%%` which always becomes `%` on non-literal macros. And for that we even have a use-case of our own, where we currently need to double-escape the % because these must not be expanded since the %'s are for the query format:
```%_build_name_fmt        %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/4129#discussion_r2980380293
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/4129/review/3997830250 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20260324/b626a65d/attachment.htm>


More information about the Rpm-maint mailing list