* [gentoo-commits] gentoo-x86 commit in app-admin/lsyncd/files: lsyncd-2.0.7-lua52.patch lsyncd-2.0.7-lua51.patch
@ 2012-09-23 8:37 Pacho Ramos (pacho)
0 siblings, 0 replies; 2+ messages in thread
From: Pacho Ramos (pacho) @ 2012-09-23 8:37 UTC (permalink / raw
To: gentoo-commits
pacho 12/09/23 08:37:11
Added: lsyncd-2.0.7-lua52.patch lsyncd-2.0.7-lua51.patch
Log:
Fix compilation with lua-5.2, bug #434238 by Dennis Schridde.
(Portage version: 2.1.11.19/cvs/Linux x86_64)
Revision Changes Path
1.1 app-admin/lsyncd/files/lsyncd-2.0.7-lua52.patch
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/lsyncd/files/lsyncd-2.0.7-lua52.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/lsyncd/files/lsyncd-2.0.7-lua52.patch?rev=1.1&content-type=text/plain
Index: lsyncd-2.0.7-lua52.patch
===================================================================
From 9e24c121e502ebd8e88821044d78fda187537861 Mon Sep 17 00:00:00 2001
From: Dennis Schridde <devurandom@gmx.net>
Date: Tue, 18 Sep 2012 15:20:25 +0200
Subject: [PATCH] Fix compilation with Lua 5.2 (issue #146)
---
inotify.c | 4 ++--
lsyncd.c | 10 +++++-----
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/inotify.c b/inotify.c
index 432e530..ac6f7d9 100644
--- a/inotify.c
+++ b/inotify.c
@@ -129,7 +129,7 @@
/**
* Cores inotify functions.
*/
-static const luaL_reg linotfylib[] = {
+static const luaL_Reg linotfylib[] = {
{"addwatch", l_addwatch },
{"rmwatch", l_rmwatch },
{NULL, NULL}
@@ -352,7 +352,7 @@
register_inotify(lua_State *L)
{
lua_pushstring(L, "inotify");
- luaL_register(L, "inotify", linotfylib);
+ luaL_newlib(L, linotfylib);
}
/**
diff --git a/lsyncd.c b/lsyncd.c
index fbb5d33..f7c61c2 100644
--- a/lsyncd.c
+++ b/lsyncd.c
@@ -841,12 +841,12 @@ struct pipemsg {
if (lua_istable(L, i)) {
int tlen;
int it;
- lua_checkstack(L, lua_gettop(L) + lua_objlen(L, i) + 1);
+ lua_checkstack(L, lua_gettop(L) + lua_rawlen(L, i) + 1);
// move table to top of stack
lua_pushvalue(L, i);
lua_remove(L, i);
argc--;
- tlen = lua_objlen(L, -1);
+ tlen = lua_rawlen(L, -1);
for (it = 1; it <= tlen; it++) {
lua_pushinteger(L, it);
lua_gettable(L, -2);
@@ -1263,7 +1263,7 @@ struct pipemsg {
return 0;
}
-static const luaL_reg lsyncdlib[] = {
+static const luaL_Reg lsyncdlib[] = {
{"configure", l_configure },
{"exec", l_exec },
{"log", l_log },
@@ -1368,7 +1368,7 @@ struct pipemsg {
void
register_lsyncd(lua_State *L)
{
- luaL_register(L, "lsyncd", lsyncdlib);
+ luaL_newlib(L, lsyncdlib);
lua_setglobal(L, "lysncd");
// creates the metatable for jiffies userdata
@@ -1676,7 +1676,7 @@ struct pipemsg {
int argp = 1;
// load Lua
- L = lua_open();
+ L = luaL_newstate();
luaL_openlibs(L);
{
// checks the lua version
--
1.7.10
1.1 app-admin/lsyncd/files/lsyncd-2.0.7-lua51.patch
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/lsyncd/files/lsyncd-2.0.7-lua51.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/lsyncd/files/lsyncd-2.0.7-lua51.patch?rev=1.1&content-type=text/plain
Index: lsyncd-2.0.7-lua51.patch
===================================================================
From 595370fdc4d106d093184893c037ec00e9abcae9 Mon Sep 17 00:00:00 2001
From: Dennis Schridde <devurandom@gmx.net>
Date: Tue, 18 Sep 2012 15:57:41 +0200
Subject: [PATCH] Lua 5.1 compatibility fallbacks
---
inotify.c | 4 ++++
lsyncd.c | 6 ++++++
2 files changed, 10 insertions(+)
diff --git a/inotify.c b/inotify.c
index ac6f7d9..518c329 100644
--- a/inotify.c
+++ b/inotify.c
@@ -39,6 +39,10 @@
#include <lualib.h>
#include <lauxlib.h>
+#if LUA_VERSION_NUM < 502
+# define luaL_newlib(L,l) luaL_register(L,NULL,l)
+#endif
+
/*-----------------------------------------------------------------------------
* Event types.
*/
diff --git a/lsyncd.c b/lsyncd.c
index f7c61c2..74629bd 100644
--- a/lsyncd.c
+++ b/lsyncd.c
@@ -53,6 +53,12 @@
extern const char defaults_out[];
extern size_t defaults_size;
+#if LUA_VERSION_NUM < 502
+/* lua_rawlen: Not entirely correct, but should work anyway */
+# define lua_rawlen lua_objlen
+# define luaL_newlib(L,l) luaL_register(L,NULL,l)
+#endif
+
/**
* Makes sure there is one monitor.
*/
--
1.7.10
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] gentoo-x86 commit in app-admin/lsyncd/files: lsyncd-2.0.7-lua52.patch lsyncd-2.0.7-lua51.patch
@ 2014-01-23 0:46 Tim Harder (radhermit)
0 siblings, 0 replies; 2+ messages in thread
From: Tim Harder (radhermit) @ 2014-01-23 0:46 UTC (permalink / raw
To: gentoo-commits
radhermit 14/01/23 00:46:27
Removed: lsyncd-2.0.7-lua52.patch lsyncd-2.0.7-lua51.patch
Log:
Remove old.
(Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key 4AB3E85B4F064CA3)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-01-23 0:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-23 8:37 [gentoo-commits] gentoo-x86 commit in app-admin/lsyncd/files: lsyncd-2.0.7-lua52.patch lsyncd-2.0.7-lua51.patch Pacho Ramos (pacho)
-- strict thread matches above, loose matches on Subject: below --
2014-01-23 0:46 Tim Harder (radhermit)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox