rpms/stratagus/FC-6 stratagus--lua-5.1.diff, 1.1, 1.2 stratagus.spec, 1.11, 1.12
Peter Lemenkov (peter)
fedora-extras-commits at redhat.com
Thu Nov 16 20:31:07 UTC 2006
Author: peter
Update of /cvs/extras/rpms/stratagus/FC-6
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv3018/FC-6
Modified Files:
stratagus--lua-5.1.diff stratagus.spec
Log Message:
Finally, got it work with Lua5.1
stratagus--lua-5.1.diff:
Index: stratagus--lua-5.1.diff
===================================================================
RCS file: /cvs/extras/rpms/stratagus/FC-6/stratagus--lua-5.1.diff,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- stratagus--lua-5.1.diff 15 Sep 2006 21:00:04 -0000 1.1
+++ stratagus--lua-5.1.diff 16 Nov 2006 20:30:36 -0000 1.2
@@ -95,3 +95,78 @@
DebugPrint("Garbage collect (after): %d/%d\n" _C_
lua_getgccount(Lua) _C_ lua_getgcthreshold(Lua));
+--- src/stratagus/script.c.hdg 2006-11-14 23:35:39.000000000 +0100
++++ src/stratagus/script.c 2006-11-14 23:35:39.000000000 +0100
+@@ -149,6 +149,23 @@
+ return status;
+ }
+
++static int traceback (lua_State *L) {
++ lua_getfield(L, LUA_GLOBALSINDEX, "debug");
++ if (!lua_istable(L, -1)) {
++ lua_pop(L, 1);
++ return 1;
++ }
++ lua_getfield(L, -1, "traceback");
++ if (!lua_isfunction(L, -1)) {
++ lua_pop(L, 2);
++ return 1;
++ }
++ lua_pushvalue(L, 1); /* pass error message */
++ lua_pushinteger(L, 2); /* skip this function and traceback */
++ lua_call(L, 2, 1); /* call debug.traceback */
++ return 1;
++}
++
+ /**
+ ** Call a lua function
+ **
+@@ -159,19 +176,19 @@
+ */
+ int LuaCall(int narg, int clear)
+ {
+- int status;
+- int base;
+-
+- base = lua_gettop(Lua) - narg; // function index
+- lua_pushliteral(Lua, "_TRACEBACK");
+- lua_rawget(Lua, LUA_GLOBALSINDEX); // get traceback function
+- lua_insert(Lua, base); // put it under chunk and args
+- signal(SIGINT, laction);
+- status = lua_pcall(Lua, narg, (clear ? 0 : LUA_MULTRET), base);
+- signal(SIGINT, SIG_DFL);
+- lua_remove(Lua, base); // remove traceback function
+-
+- return report(status);
++ int status;
++ int base = lua_gettop(Lua) - narg; /* function index */
++ lua_pushcfunction(Lua, traceback); /* push traceback function */
++ lua_insert(Lua, base); /* put it under chunk and args */
++ signal(SIGINT, laction);
++ status = lua_pcall(Lua, narg, (clear ? 0 : LUA_MULTRET), base);
++ signal(SIGINT, SIG_DFL);
++ lua_remove(Lua, base); /* remove traceback function */
++#if 0
++ /* force a complete garbage collection in case of errors */
++ if (status != 0) lua_gc(Lua, LUA_GCCOLLECT, 0);
++#endif
++ return report(status);
+ }
+
+ /**
+--- src/ai/script_ai.c.hdg 2004-06-25 01:37:30.000000000 +0200
++++ src/ai/script_ai.c 2006-11-14 23:42:58.000000000 +0100
+@@ -349,7 +349,11 @@
+ lua_call(l, 1, 1);
+ lua_pushstring(l, "name");
+ lua_gettable(l, -2);
+- aitype->FunctionName = strdup(lua_tostring(l, -1));
++ value = lua_tostring(l, -1);
++ if (value)
++ aitype->FunctionName = strdup(lua_tostring(l, -1));
++ else
++ aitype->FunctionName = NULL;
+ lua_pop(l, 2); // FIXME : check if this value is correct.
+ // We can have opcode of this function with string.dump(function)
+ // Problems are for sub functions...
+
Index: stratagus.spec
===================================================================
RCS file: /cvs/extras/rpms/stratagus/FC-6/stratagus.spec,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- stratagus.spec 16 Sep 2006 10:48:38 -0000 1.11
+++ stratagus.spec 16 Nov 2006 20:30:36 -0000 1.12
@@ -6,7 +6,7 @@
Name: stratagus
Summary: Real-time strategy gaming engine
Version: 2.1
-Release: 9%{?dist}
+Release: 10%{?dist}
License: GPL
Group: Development/Libraries
URL: http://stratagus.sourceforge.net/
@@ -79,6 +79,9 @@
%changelog
+* Thu Nov 16 2006 Peter Lemenkov <lemenkov at gmail.com> 2.1-10
+- Applied patches from Hans de Goede
+
* Sat Sep 16 2006 Peter Lemenkov <lemenkov at gmail.com> 2.1-9%{?dist}
- Added necessary BuildRequires
More information about the scm-commits
mailing list