RPM Package Manager, CVS Repository
http://rpm5.org/cvs/
____________________________________________________________________________
Server: rpm5.org Name: Ralf S. Engelschall
Root: /v/rpm/cvs Email: rse@rpm5.org
Module: rpm lua Date: 24-Dec-2007 15:50:14
Branch: HEAD Handle: 2007122414501300
Modified files:
lua bin2c.c
rpm CHANGES
Log:
add error handling to the Lua script loading code generated by bin2c
Summary:
Revision Changes Path
1.2 +2 -1 lua/bin2c.c
1.2014 +1 -0 rpm/CHANGES
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: lua/bin2c.c
============================================================================
$ cvs diff -u -r1.1 -r1.2 bin2c.c
--- lua/bin2c.c 15 Jul 2007 17:56:10 -0000 1.1
+++ lua/bin2c.c 24 Dec 2007 14:50:13 -0000 1.2
@@ -43,7 +43,8 @@
static void emit(const char* fn, int n)
{
- printf(" if (luaL_loadbuffer(L,(const char*)B%d,sizeof(B%d),\"%s\")==0) lua_pcall(L, 0, 0, 0);\n",n,n,fn);
+ printf(" int error = luaL_loadbuffer(L,(const char*)B%d,sizeof(B%d),\"%s\") || lua_pcall(L, 0, 0, 0);\n", n, n, fn);
+ printf(" if (error) { fprintf(stderr, \"error: Lua script failed: %%s\", lua_tostring(L, -1)); lua_pop(L, 1); }\n");
}
int main(int argc, char* argv[])
@@ .
patch -p0 <<'@@ .'
Index: rpm/CHANGES
============================================================================
$ cvs diff -u -r1.2013 -r1.2014 CHANGES
--- rpm/CHANGES 24 Dec 2007 09:14:50 -0000 1.2013
+++ rpm/CHANGES 24 Dec 2007 14:50:13 -0000 1.2014
@@ -1,4 +1,5 @@
5.0b3 -> 5.0b4:
+ - rse: add error handling to the Lua script loading code generated by bin2c
- rse: add an RPM Lua function rpm.load() for loading external RPM macro definition file
- rse: provide RPM Lua function rpm.undefine() based on the C function rpmUndefineMacro
- rse: provide rpmUndefineMacro API function to complement the existing rpmDefineMacro API function
@@ .
Received on Mon Dec 24 15:50:14 2007