updated on Wed Jan 25 00:20:47 UTC 2012
[aur-mirror.git] / luapgsql / patch.diff
blob0e2afd66113ba314e344acaa15b0899ed22b8086
1 diff -Naur old/luapgsql.c new/luapgsql.c
2 --- luapgsql/luapgsql.c 2008-04-01 21:07:09.000000000 -0300
3 +++ luapgsql/luapgsql.c 2008-06-22 22:37:33.000000000 -0300
4 @@ -60,39 +60,13 @@
5 /* push a table onto the stack containing a row of data */
6 void lua_pushpgdata(lua_State *L, PGresult *rs, int row, int col) {
7 const char *val;
8 - double temp;
9 /* grab the value */
10 if (PQgetisnull(rs, row, col)) {
11 /* tasty NULLs - take that PHP! */
12 lua_pushnil(L);
13 } else {
14 val = PQgetvalue(rs, row, col);
15 - switch (PQftype(rs, col)) {
16 - case BOOLOID:
17 - /* map postgresql default bool format */
18 - if (val[0] == 't') {
19 - lua_pushboolean(L, 1);
20 - } else {
21 - lua_pushboolean(L, 0);
22 - }
23 - break;
24 - case INT2OID:
25 - case INT4OID:
26 - case INT8OID:
27 - case FLOAT4OID:
28 - case FLOAT8OID:
29 - case NUMERICOID:
30 - /* convert using Lua string -> number conversion for reliability */
31 - lua_pushstring(L, val);
32 - temp = lua_tonumber(L, -1);
33 - lua_pop(L, 1);
34 - lua_pushnumber(L, temp);
35 - break;
36 - default:
37 - /* it's all just a string after that */
38 - lua_pushstring(L, val);
39 - break;
40 - }
41 + lua_pushstring(L, val);
45 diff -Naur old/Makefile new/Makefile
46 --- luapgsql/Makefile 2008-04-01 21:07:09.000000000 -0300
47 +++ luapgsql/Makefile 2008-06-22 22:22:51.000000000 -0300
48 @@ -1,18 +1,12 @@
49 # makefile for pgsql library for Lua
51 # Lua setup
52 -LUA= /usr/local
53 -LUAINC= $(LUA)/include/lua51
54 -LUALIB= $(LUA)/lib/lua51
56 -# these will probably work if Lua has been installed globally
57 -#LUA= /usr/local/
58 -#LUAINC= $(LUA)/include
59 -#LUALIB= $(LUA)/lib
60 -#LUABIN= $(LUA)/bin
61 +LUA= /usr
62 +LUAINC= $(LUA)/include
63 +LUALIB= $(LUA)/lib/lua
65 # libpq setup
66 -LPQ= /usr/local
67 +LPQ= /usr
68 LPQINC= $(LPQ)/include
69 LPQLIB= $(LPQ)/lib
71 @@ -27,7 +21,6 @@
72 MYLIB= lua$(MYNAME)
74 OBJS= $(MYLIB).o
75 -#STATIC_OBJS= foobar.o
76 T= $(MYNAME).so
78 all: so
79 @@ -41,20 +34,13 @@
81 clean:
82 rm -f $(OBJS) $T core core.*
84 -#doc:
85 -# @echo "$(MYNAME) library:"
86 -# @fgrep '/**' $(MYLIB).c | cut -f2 -d/ | tr -d '*' | sort | column
88 -# distribution
91 D= $(MYNAME)
92 A= $(MYLIB).tgz
93 TOTAR= Makefile,$(MYLIB).c,test.lua
95 tar: clean
96 tar zcvf $A -C .. $D
97 -# tar zcvf $A -C .. $D/{$(TOTAR)}
99 distr: tar
100 touch -r $A .stamp