[Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1419)
Panu Matilainen
notifications at github.com
Fri Jan 22 11:11:46 UTC 2021
@pmatilai commented on this pull request.
> + lua_settop(L, 1);
+ rc = rpm_expand(L);
+ }
+ }
+ return rc;
+}
+
+static int mc_newindex(lua_State *L)
+{
+ rpmMacroContext *mc = checkmc(L, 1);
+ const char *name = luaL_checkstring(L, 2);
+ if (lua_isnil(L, 3)) {
+ if (rpmPopMacro(*mc, name))
+ luaL_error(L, "error undefining macro %s", name);
+ } else {
+ const char *body = luaL_checkstring(L, 3);
There's no actual error in that happening, one could even consider it a feature that strings are \0-terminated everywhere in rpm.
--
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/1419#discussion_r562560519
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20210122/f77322d9/attachment.html>
More information about the Rpm-maint
mailing list