robert pushed to lua-socket (el6). "Merge remote branch 'origin/master' into el6"

notifications at fedoraproject.org notifications at fedoraproject.org
Wed May 20 18:59:54 UTC 2015


From e321e4ca0020844f816873e3fe01ba5663f6245c Mon Sep 17 00:00:00 2001
From: Robert Scheck <robert at fedoraproject.org>
Date: Sun, 10 May 2015 21:27:41 +0200
Subject: Added upstream patch to fix settimeout() bug (#1220171)


diff --git a/lua-socket-unix-sockets.patch b/lua-socket-unix-sockets.patch
deleted file mode 100644
index f2895c3..0000000
--- a/lua-socket-unix-sockets.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-diff -ur luasocket-2.0.2.bak//makefile luasocket-2.0.2/makefile
---- luasocket-2.0.2.bak//makefile	2007-10-15 00:21:05.000000000 -0400
-+++ luasocket-2.0.2/makefile	2011-07-12 10:30:37.340052899 -0400
-@@ -10,6 +10,7 @@
- INSTALL_SOCKET_LIB=$(INSTALL_TOP_LIB)/socket
- INSTALL_MIME_SHARE=$(INSTALL_TOP_SHARE)/mime
- INSTALL_MIME_LIB=$(INSTALL_TOP_LIB)/mime
-+INSTALL_UNIX_LIB=$(INSTALL_SOCKET_LIB)
- 
- all clean:
- 	cd src; $(MAKE) $@
-@@ -45,6 +46,8 @@
- 	#cd src; $(INSTALL_DATA) $(TO_MIME_SHARE) $(INSTALL_MIME_SHARE)
- 	cd src; mkdir -p $(INSTALL_MIME_LIB)
- 	cd src; $(INSTALL_EXEC) $(MIME_SO) $(INSTALL_MIME_LIB)/core.$(EXT)
-+	cd src; mkdir -p $(INSTALL_UNIX_LIB)
-+	cd src; $(INSTALL_EXEC) $(UNIX_SO) $(INSTALL_UNIX_LIB)/$(UNIX_SO)
- 
- #------
- # End of makefile
-diff -ur luasocket-2.0.2.bak//src/makefile luasocket-2.0.2/src/makefile
---- luasocket-2.0.2.bak//src/makefile	2007-10-15 00:21:05.000000000 -0400
-+++ luasocket-2.0.2/src/makefile	2011-07-12 10:29:49.794050617 -0400
-@@ -47,7 +47,7 @@
- 	usocket.o \
- 	unix.o
- 
--all: $(SOCKET_SO) $(MIME_SO) 
-+all: $(SOCKET_SO) $(MIME_SO) $(UNIX_SO)
- 
- $(SOCKET_SO): $(SOCKET_OBJS)
- 	$(LD) $(LDFLAGS) -o $@ $(SOCKET_OBJS)
diff --git a/lua-socket.spec b/lua-socket.spec
index 1f23c3a..3312c70 100644
--- a/lua-socket.spec
+++ b/lua-socket.spec
@@ -20,7 +20,7 @@
 
 Name:           lua-socket
 Version:        3.0
-Release:        0.9.rc1%{?dist}
+Release:        0.10.rc1%{?dist}
 Summary:        Network support for the Lua language
 
 Group:          Development/Libraries
@@ -28,10 +28,11 @@ License:        MIT
 URL:            http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/
 #Source0:        http://luaforge.net/frs/download.php/2664/luasocket-%{baseversion}.tar.gz
 Source0:        https://github.com/diegonehab/%{upstreamname}/archive/v%{baseversion}.tar.gz
-Patch0:		    luasocket-optflags.patch
+Patch0:         luasocket-optflags.patch
 # All changes in the upstream repo from %{baseversion} tag to the
 # current master. Seems to be harmless.
 Patch1:         luasocket-no-global-vars.patch
+Patch2:         luasocket-3.0-settimeout.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  lua >= %{luaver}, lua-devel >= %{luaver}
@@ -77,6 +78,7 @@ and FTP. In addition there are modules for MIME, URL handling and LTN12.
 %setup -q -n %{upstreamname}-%{baseversion}
 %patch0 -p1 -b .optflags
 %patch1 -p1 -b .noglobal
+%patch2 -p1 -b .settimeout
 
 %if 0%{?fedora} >= 20
 rm -rf %{lua51dir}
@@ -120,8 +122,9 @@ popd
 
 %files
 %defattr(-,root,root,-)
-%doc doc/*
-%doc README LICENSE
+%{!?_licensedir:%global license %%doc}
+%license LICENSE
+%doc README doc/*
 %{lualibdir}/*
 %{luapkgdir}/*
 
@@ -132,13 +135,17 @@ popd
 %if 0%{?fedora} >= 20
 %files compat
 %defattr(-,root,root,-)
-%doc doc/*
-%doc README LICENSE
+%{!?_licensedir:%global license %%doc}
+%license LICENSE
+%doc README doc/*
 %{luacompatlibdir}/*
 %{luacompatpkgdir}/*
 %endif
 
 %changelog
+* Sun May 10 2015 Robert Scheck <robert at fedoraproject.org> 3.0-0.10.rc1
+- Added upstream patch to fix settimeout() bug (#1220171)
+
 * Mon May 04 2015 Robert Scheck <robert at fedoraproject.org> 3.0-0.9.rc1
 - Fix broken release tag
 
diff --git a/luasocket-3.0-settimeout.patch b/luasocket-3.0-settimeout.patch
new file mode 100644
index 0000000..724ec24
--- /dev/null
+++ b/luasocket-3.0-settimeout.patch
@@ -0,0 +1,53 @@
+From 396e9e5ee67dd3169aef6ef734d1f5e6f0ec76a9 Mon Sep 17 00:00:00 2001
+From: Diego Nehab <diego at impa.br>
+Date: Mon, 9 Sep 2013 14:23:00 -0300
+Subject: [PATCH] Fixed timeout bug introduced by commit e81a6ff
+
+---
+ src/buffer.c | 12 ++++--------
+ 1 file changed, 4 insertions(+), 8 deletions(-)
+
+diff --git a/src/buffer.c b/src/buffer.c
+index 4ef4e8e..423d804 100644
+--- a/src/buffer.c
++++ b/src/buffer.c
+@@ -78,9 +78,7 @@ int buffer_meth_send(lua_State *L, p_buffer buf) {
+     const char *data = luaL_checklstring(L, 2, &size);
+     long start = (long) luaL_optnumber(L, 3, 1);
+     long end = (long) luaL_optnumber(L, 4, -1);
+-#ifdef LUASOCKET_DEBUG
+-    p_timeout tm = timeout_markstart(buf->tm);
+-#endif
++    timeout_markstart(buf->tm);
+     if (start < 0) start = (long) (size+start+1);
+     if (end < 0) end = (long) (size+end+1);
+     if (start < 1) start = (long) 1;
+@@ -98,7 +96,7 @@ int buffer_meth_send(lua_State *L, p_buffer buf) {
+     }
+ #ifdef LUASOCKET_DEBUG
+     /* push time elapsed during operation as the last return value */
+-    lua_pushnumber(L, timeout_gettime() - timeout_getstart(tm));
++    lua_pushnumber(L, timeout_gettime() - timeout_getstart(buf->tm));
+ #endif
+     return lua_gettop(L) - top;
+ }
+@@ -111,9 +109,7 @@ int buffer_meth_receive(lua_State *L, p_buffer buf) {
+     luaL_Buffer b;
+     size_t size;
+     const char *part = luaL_optlstring(L, 3, "", &size);
+-#ifdef LUASOCKET_DEBUG
+-    p_timeout tm = timeout_markstart(buf->tm);
+-#endif
++    timeout_markstart(buf->tm);
+     /* initialize buffer with optional extra prefix 
+      * (useful for concatenating previous partial results) */
+     luaL_buffinit(L, &b);
+@@ -149,7 +145,7 @@ int buffer_meth_receive(lua_State *L, p_buffer buf) {
+     }
+ #ifdef LUASOCKET_DEBUG
+     /* push time elapsed during operation as the last return value */
+-    lua_pushnumber(L, timeout_gettime() - timeout_getstart(tm));
++    lua_pushnumber(L, timeout_gettime() - timeout_getstart(buf->tm));
+ #endif
+     return lua_gettop(L) - top;
+ }
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/lua-socket.git/commit/?h=el6&id=17fc3bd6ff4425017c7d54bdb636e26441a31be9


More information about the scm-commits mailing list