[Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1419)

Demi Marie Obenour notifications at github.com
Mon Jan 11 17:11:03 UTC 2021


@DemiMarie 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);

Throwing a useful error rather than a silent failure.

-- 
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_r555205961
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20210111/f72846ef/attachment.html>


More information about the Rpm-maint mailing list