[Rpm-maint] [rpm-software-management/rpm] Implement simple macro objects (PR #1826)
Michael Schroeder
notifications at github.com
Thu Nov 11 14:46:56 UTC 2021
A macro object is a special macro that stores its type in the
'opts' element and delegates the expansion to other macros.
The first argument in the expansion is used as the method name.
E.g. the expansion of %{myarray push bar} will delegate to the
%_array_push macro if %myarray is of type "array".
There are two special methods:
_init is used to set up the object and must always be present.
_expand is used if the macro is expanded without arguments and
defaults to just using the literal macro body.
There are two new builtins to get/set the macro body of a macro
object: getobjectbody and setobjectbody. They can be used to store
a string in the macro object without delegation.
You can view, comment on, or merge this pull request online at:
https://github.com/rpm-software-management/rpm/pull/1826
-- Commit Summary --
* <a href="https://github.com/rpm-software-management/rpm/pull/1826/commits/e946c7f48d1d36729dd3c01f4642f03f0c812d7c">Implement simple macro objects</a>
-- File Changes --
M rpmio/macro.c (145)
M tests/rpmmacro.at (16)
-- Patch Links --
https://github.com/rpm-software-management/rpm/pull/1826.patch
https://github.com/rpm-software-management/rpm/pull/1826.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/1826
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20211111/7b55af3c/attachment.html>
More information about the Rpm-maint
mailing list