Browse Source

lua-posix: Updated (5.0-t2 -> 5.1.11)

stable/0.2
Alejandro Mery 14 years ago
parent
commit
ca108923a4
  1. 38
      lua/lua-posix/clk_tck.patch
  2. 15
      lua/lua-posix/lua-posix.desc
  3. 77
      lua/lua-posix/makefile.patch
  4. 59
      lua/lua-posix/t2-ext-glob.patch
  5. 74
      lua/lua-posix/update-lua51.patch

38
lua/lua-posix/clk_tck.patch

@ -1,38 +0,0 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../lua-posix/clk_tck.patch
# Copyright (C) 2006 The T2 SDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
diff -ur posix/lposix.c posix-t2/lposix.c
--- posix/lposix.c 2003-11-06 01:23:48.000000000 +0100
+++ posix-t2/lposix.c 2006-02-01 22:15:50.000000000 +0100
@@ -599,7 +599,7 @@
clock_t elapsed;
};
-#define pushtime(L,x) lua_pushnumber(L,((lua_Number)x)/CLK_TCK)
+#define pushtime(L,x) lua_pushnumber(L,((lua_Number)x)/CLOCKS_PER_SEC)
static int Ftimes(lua_State *L, int i, const void *data)
{
@@ -620,7 +620,7 @@
"utime", "stime", "cutime", "cstime", "elapsed", NULL
};
-#define storetime(L,name,x) storenumber(L,name,(lua_Number)x/CLK_TCK)
+#define storetime(L,name,x) storenumber(L,name,(lua_Number)x/CLOCKS_PER_SEC)
static int Ptimes(lua_State *L) /** times() */
{

15
lua/lua-posix/lua-posix.desc

@ -2,7 +2,7 @@
[COPY] This copyright note is auto-generated by ./scripts/Create-CopyPatch. [COPY] This copyright note is auto-generated by ./scripts/Create-CopyPatch.
[COPY] [COPY]
[COPY] Filename: package/.../lua-posix/lua-posix.desc [COPY] Filename: package/.../lua-posix/lua-posix.desc
[COPY] Copyright (C) 2006 The OpenSDE Project [COPY] Copyright (C) 2006 - 2011 The OpenSDE Project
[COPY] Copyright (C) 2004 - 2006 The T2 SDE Project [COPY] Copyright (C) 2004 - 2006 The T2 SDE Project
[COPY] [COPY]
[COPY] More information can be found in the files COPYING and README. [COPY] More information can be found in the files COPYING and README.
@ -12,22 +12,23 @@
[COPY] the Free Software Foundation; version 2 of the License. A copy of the [COPY] the Free Software Foundation; version 2 of the License. A copy of the
[COPY] GNU General Public License can be found in the file COPYING. [COPY] GNU General Public License can be found in the file COPYING.
[COPY] --- SDE-COPYRIGHT-NOTE-END --- [COPY] --- SDE-COPYRIGHT-NOTE-END ---
[I] A POSIX library for Lua [I] A POSIX library for Lua
[T] A library for lua containing POSIX commands: [T] A library for lua containing POSIX commands:
[T] setenv,getenv,mkdir,chmod,fork, etc.. [T] setenv,getenv,mkdir,chmod,fork, etc..
[U] http://luaforge.net/projects/lposix/ [U] http://luaforge.net/projects/luaposix/
[A] Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> [A] Natanael Copa <natanael.copa@gmail.com> {maintainer}
[A] Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> {old maintainer}
[M] The OpenSDE Community <list@opensde.org> [M] The OpenSDE Community <list@opensde.org>
[C] extra/development [C] extra/development
[L] PublicDomain [L] MIT
[S] Stable [S] Stable
[V] 5.0-t2 [V] 5.1.11
[P] X -----5---9 800.000 [P] X -----5---9 800.000
[D] 4160754093 lposix-5.0.tar.gz !http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/lposix.tar.gz [D] 3623417252 luaposix-5.1.11.tar.gz http://luaforge.net/frs/download.php/4813/

77
lua/lua-posix/makefile.patch

@ -1,77 +0,0 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../lua-posix/makefile.patch
# Copyright (C) 2006 The OpenSDE Project
# Copyright (C) 2004 - 2006 The T2 SDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
--- posix/Makefile 2003-11-06 01:26:49.000000000 +0100
+++ posix-5.1-alpha/Makefile 2005-09-04 14:17:03.000000000 +0200
@@ -1,10 +1,20 @@
# makefile for POSIX library for Lua
# change these to reflect your Lua installation
-LUA= /tmp/lhf/lua-5.0
-LUAINC= $(LUA)/include
-LUALIB= $(LUA)/lib
-LUABIN= $(LUA)/bin
+LUA= lua
+
+LUAINC= $(LUA_ROOT)/include
+LUALIB= $(LUA_ROOT)/lib
+LUABIN= $(LUA_ROOT)/bin
+
+# installation path
+LUA_ROOT= $(shell pkg-config --variable prefix lua)
+LUA_CDIR= $(shell pkg-config --variable INSTALL_CMOD lua)
+LUA_LDIR= $(shell pkg-config --variable INSTALL_LMOD lua)
+
+INSTALL = install
+INSTALL_DATA = $(INSTALL) -m 644
+INSTALL_EXEC = $(INSTALL) -m 755
# no need to change anything below here
CFLAGS= -fPIC $(INCS) $(WARN) -O2 $G
@@ -16,23 +26,25 @@
OBJS= $(MYLIB).o
-T= $(MYLIB).so
+all: $(MYLIB).so
-all: test
+test: $(MYLIB).so
+ $(LUA) -l$(MYNAME) test.lua
-test: $T
- $(LUABIN)/lua -l$(MYNAME) test.lua
+$(MYLIB).so: $(OBJS)
+ $(CC) $(LDFLAGS) -o $@ -shared $(OBJS)
-$T: $(OBJS)
- $(CC) -o $@ -shared $(OBJS)
+install:
+ $(INSTALL_EXEC) $(MYLIB).so $(LUA_CDIR)/
+ $(INSTALL_DATA) $(MYNAME).lua $(LUA_LDIR)/
$(OBJS): modemuncher.c
-tree: $T
+tree: $(MYLIB).so
$(LUABIN)/lua -l$(MYNAME) tree.lua .
clean:
- rm -f $(OBJS) $T core core.* a.out
+ rm -f $(OBJS) $(MYLIB).so core core.* a.out
x:
@echo "$(MYNAME) library:"

59
lua/lua-posix/t2-ext-glob.patch

@ -1,59 +0,0 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../lua-posix/t2-ext-glob.patch
# Copyright (C) 2004 - 2006 The T2 SDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
--- posix/lposix.c 2005-09-08 21:50:42.445019600 +0200
+++ posix-t2/lposix.c 2005-09-08 21:49:14.994723494 +0200
@@ -22,6 +22,7 @@
#include <time.h>
#include <unistd.h>
#include <utime.h>
+#include <glob.h>
#define MYNAME "posix"
#define MYVERSION MYNAME " library for " LUA_VERSION " / Nov 2003"
@@ -177,6 +178,25 @@
}
+static int Pglob(lua_State *L) /** glob(pattern) */
+{
+ const char *pattern = luaL_optstring(L, 1, ".");
+ glob_t globres;
+
+ if (glob(pattern, GLOB_MARK, NULL, &globres))
+ return pusherror(L, pattern);
+ else
+ {
+ int i;
+ lua_newtable(L);
+ for (i=1; i<=globres.gl_pathc; i++)
+ storeindex(L, i, globres.gl_pathv[i-1]);
+ globfree(&globres);
+ return 1;
+ }
+}
+
+
static int aux_files(lua_State *L)
{
DIR *d = lua_touserdata(L, lua_upvalueindex(1));
@@ -773,6 +793,7 @@
{"getlogin", Pgetlogin},
{"getpasswd", Pgetpasswd},
{"getprocessid", Pgetprocessid},
+ {"glob", Pglob},
{"kill", Pkill},
{"link", Plink},
{"mkdir", Pmkdir},

74
lua/lua-posix/update-lua51.patch

@ -1,74 +0,0 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../lua-posix/update-lua51.patch
# Copyright (C) 2004 - 2006 The T2 SDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
--- posix/lposix.c 2003-11-06 01:23:48.000000000 +0100
+++ posix-5.1-alpha/lposix.c 2005-09-04 13:59:15.000000000 +0200
@@ -64,7 +64,7 @@
}
else
{
- int j=luaL_findstring(luaL_checkstring(L, i), S);
+ int j=luaL_checkoption(L, i, NULL, S);
if (j==-1) luaL_argerror(L, i, "unknown selector");
return F(L, j, data);
}
@@ -802,7 +802,7 @@
{NULL, NULL}
};
-LUALIB_API int luaopen_posix (lua_State *L)
+LUALIB_API int luaopen_lposix (lua_State *L)
{
luaL_openlib(L, MYNAME, R, 0);
lua_pushliteral(L,"version"); /** version */
--- posix/posix.lua 2003-06-18 14:47:44.000000000 +0200
+++ posix-5.1-alpha/posix.lua 2005-09-04 14:15:14.000000000 +0200
@@ -1,10 +1,4 @@
-- posix.lua
-- support code for posix library
--- usage lua -lposix ...
-local function so(x)
- local SOPATH= os.getenv"LUA_SOPATH" or "./"
- assert(loadlib(SOPATH.."l"..x..".so","luaopen_"..x))()
-end
-
-so"posix"
+require"lposix"
--- posix/test.lua 2003-11-07 12:42:30.000000000 +0100
+++ posix-5.1-alpha/test.lua 2005-09-04 13:51:39.000000000 +0200
@@ -41,7 +41,7 @@
f"HOME"
f"SHELL"
f"absent"
-for k in ox.getenv() do io.write(k,"\t") end io.write"\n"
+for k,_ in pairs(ox.getenv()) do io.write(k,"\t") end io.write"\n"
------------------------------------------------------------------------------
testing"putenv"
@@ -179,11 +179,11 @@
------------------------------------------------------------------------------
testing"times"
a=ox.times()
-for k,v in a do print(k,v) end
+for k,v in pairs(a) do print(k,v) end
print"sleeping 10 seconds..."
ox.sleep(10)
b=ox.times()
-for k,v in b do print(k,v) end
+for k,v in pairs(b) do print(k,v) end
print""
print("elapsed",b.elapsed-a.elapsed)
print("clock",os.clock())
Loading…
Cancel
Save