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

2021-01-27 Thread Panu Matilainen
Merged #1419 into master. -- 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#event-4255618529___ Rpm-maint mailing list

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

2021-01-27 Thread Panu Matilainen
Since there are no further comments... -- 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#issuecomment-768255053___ Rpm-maint

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

2021-01-25 Thread Panu Matilainen
Realized that documentation is missing, this has gone on so long now that a whole documentation project was started in the meanwhile... -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

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

2021-01-22 Thread Panu Matilainen
@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,

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

2021-01-22 Thread Demi Marie Obenour
@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,

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

2021-01-22 Thread Panu Matilainen
Dusted this off and made macros.define() and macros.global() work. I think it's time to get this in. There are some quirks and inconsistencies present largely due to how convoluted this all is in the macro engine itself, but fixing all that is hard while there are no users for the code - ie

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

2021-01-22 Thread Panu Matilainen
@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,

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

2021-01-22 Thread Panu Matilainen
@pmatilai pushed 2 commits. 9cb30fde3fb6520ae3d313fd8abc4d3b4d99b318 Let %define and %global take name and body as separate arguments 797e98bf694b25d1d82f6f97d316faedbda1f21f Implement a table-like shortcut to rpm macros in Lua -- You are receiving this because you are subscribed to this

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

2021-01-11 Thread Demi Marie Obenour
@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,

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

2021-01-11 Thread Panu Matilainen
@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,

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

2021-01-10 Thread Demi Marie Obenour
@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,

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

2020-10-30 Thread Panu Matilainen
Add rpm macro context as a global table-like entity named macros for a more Lua-native experience with rpm macros. Support basic indexing syntaxes (macros[k] and macros.k) for access, define and undefine operations. Undefined macros return nil here and assigning to nil will undefine (pop) the