[arch-commits] CVS update of extra/devel/lua (5 files)
Juergen Hoetzel
juergen at archlinux.org
Mon Mar 24 11:46:49 UTC 2008
Date: Monday, March 24, 2008 @ 07:46:49
Author: juergen
Path: /home/cvs-extra/extra/devel/lua
Added: lua-5.1.3-official-patch1.diff (1.1)
lua-5.1.3-official-patch2.diff (1.1)
lua-5.1.3-official-patch3.diff (1.1)
lua-5.1.3-official-patch4.diff (1.1)
Modified: PKGBUILD (1.14 -> 1.15)
upgpkg: lua 5.1.3-2 fix FS#9742
--------------------------------+
PKGBUILD | 21 +++++++++++++++------
lua-5.1.3-official-patch1.diff | 12 ++++++++++++
lua-5.1.3-official-patch2.diff | 11 +++++++++++
lua-5.1.3-official-patch3.diff | 21 +++++++++++++++++++++
lua-5.1.3-official-patch4.diff | 18 ++++++++++++++++++
5 files changed, 77 insertions(+), 6 deletions(-)
Index: extra/devel/lua/PKGBUILD
diff -u extra/devel/lua/PKGBUILD:1.14 extra/devel/lua/PKGBUILD:1.15
--- extra/devel/lua/PKGBUILD:1.14 Sat Jan 26 14:24:01 2008
+++ extra/devel/lua/PKGBUILD Mon Mar 24 07:46:48 2008
@@ -1,24 +1,33 @@
-# $Id: PKGBUILD,v 1.14 2008/01/26 19:24:01 juergen Exp $
+# $Id: PKGBUILD,v 1.15 2008/03/24 11:46:48 juergen Exp $
# Maintainer: Juergen Hoetzel <juergen at archlinux.org>
# Contributor: Damir Perisa <damir.perisa at bluewin.ch>
#
pkgname=lua
pkgver=5.1.3
-pkgrel=1
+pkgrel=2
pkgdesc="A powerful light-weight programming language designed for extending applications."
arch=(i686 x86_64)
url="http://www.lua.org/"
depends=(readline)
license=(MIT)
-source=($url/ftp/$pkgname-$pkgver.tar.gz $pkgname-arch.patch 'lua-5.1-cflags.diff')
+source=($url/ftp/$pkgname-$pkgver.tar.gz $pkgname-arch.patch 'lua-5.1-cflags.diff' \
+ lua-${pkgver}-official-patch1.diff\
+ lua-${pkgver}-official-patch2.diff\
+ lua-${pkgver}-official-patch3.diff\
+ lua-${pkgver}-official-patch4.diff)
md5sums=('a70a8dfaa150e047866dc01a46272599' '4f770160aa5f1885d6e1e050f50bcb75'\
- '249582bf1fd861ccf492d2c35a9fe732')
-
+ '249582bf1fd861ccf492d2c35a9fe732' '203027f2ddcfaf5697293c23d7915f57'\
+ 'd06c5b23daaa414348948d5b8c308d6f' 'dde56cd1d48a8bb2fb661a9aaf8380ad'\
+ '616808cee32ff328077b848131df7670')
build() {
cd $startdir/src/$pkgname-$pkgver
- patch -p1 <$startdir/src/$pkgname-arch.patch
+ patch -p1 -i $startdir/src/$pkgname-arch.patch || return 1
+ patch --ignore-whitespace src/luaconf.h $startdir/src/lua-${pkgver}-official-patch1.diff || return 1
+ patch -p0 -i $startdir/src/lua-${pkgver}-official-patch2.diff || return 1
+ patch -p0 -i $startdir/src/lua-${pkgver}-official-patch3.diff || return 1
+ patch -p0 -i $startdir/src/lua-${pkgver}-official-patch4.diff || return 1
[ "$CARCH" == "x86_64" ] && patch -Np1 -i ../lua-5.1-cflags.diff
[ "$CARCH" == "x86_64" ] && export CFLAGS="$CFLAGS -fPIC"
make INSTALL_DATA="cp -d" TO_LIB="liblua.a liblua.so.5.1 liblua.so" LUA_SO=liblua.so INSTALL_TOP=$startdir/pkg/usr\
Index: extra/devel/lua/lua-5.1.3-official-patch1.diff
diff -u /dev/null extra/devel/lua/lua-5.1.3-official-patch1.diff:1.1
--- /dev/null Mon Mar 24 07:46:49 2008
+++ extra/devel/lua/lua-5.1.3-official-patch1.diff Mon Mar 24 07:46:48 2008
@@ -0,0 +1,12 @@
+--- src/lbaselib.c
++++ src/lbaselib.c
+443c443,444
+< ** functions to consume unlimited stack space.
+---
+> ** functions to consume unlimited stack space. (must be smaller than
+> ** -LUA_REGISTRYINDEX)
+445,446c446
+< #define LUAI_MCS_AUX ((int)(INT_MAX / (4*sizeof(LUA_NUMBER))))
+< #define LUAI_MAXCSTACK (LUAI_MCS_AUX > SHRT_MAX ? SHRT_MAX : LUAI_MCS_AUX)
+---
+> #define LUAI_MAXCSTACK 8000
Index: extra/devel/lua/lua-5.1.3-official-patch2.diff
diff -u /dev/null extra/devel/lua/lua-5.1.3-official-patch2.diff:1.1
--- /dev/null Mon Mar 24 07:46:49 2008
+++ extra/devel/lua/lua-5.1.3-official-patch2.diff Mon Mar 24 07:46:49 2008
@@ -0,0 +1,11 @@
+--- src/lbaselib.c (old)
++++ src/lbaselib.c (new)
+@@ -526,7 +526,7 @@
+ status = lua_resume(co, narg);
+ if (status == 0 || status == LUA_YIELD) {
+ int nres = lua_gettop(co);
+- if (!lua_checkstack(L, nres))
++ if (!lua_checkstack(L, nres + 1))
+ luaL_error(L, "too many results to resume");
+ lua_xmove(co, L, nres); /* move yielded values */
+ return nres;
Index: extra/devel/lua/lua-5.1.3-official-patch3.diff
diff -u /dev/null extra/devel/lua/lua-5.1.3-official-patch3.diff:1.1
--- /dev/null Mon Mar 24 07:46:49 2008
+++ extra/devel/lua/lua-5.1.3-official-patch3.diff Mon Mar 24 07:46:49 2008
@@ -0,0 +1,21 @@
+--- src/lapi.c (old)
++++ src/lapi.c (new)
+@@ -93,15 +93,14 @@
+
+
+ LUA_API int lua_checkstack (lua_State *L, int size) {
+- int res;
++ int res = 1;
+ lua_lock(L);
+- if ((L->top - L->base + size) > LUAI_MAXCSTACK)
++ if (size > LUAI_MAXCSTACK || (L->top - L->base + size) > LUAI_MAXCSTACK)
+ res = 0; /* stack overflow */
+- else {
++ else if (size > 0) {
+ luaD_checkstack(L, size);
+ if (L->ci->top < L->top + size)
+ L->ci->top = L->top + size;
+- res = 1;
+ }
+ lua_unlock(L);
+ return res;
Index: extra/devel/lua/lua-5.1.3-official-patch4.diff
diff -u /dev/null extra/devel/lua/lua-5.1.3-official-patch4.diff:1.1
--- /dev/null Mon Mar 24 07:46:49 2008
+++ extra/devel/lua/lua-5.1.3-official-patch4.diff Mon Mar 24 07:46:49 2008
@@ -0,0 +1,18 @@
+--- src/lbaselib.c (old)
++++ src/lbaselib.c (new)
+@@ -344,10 +344,12 @@
+ luaL_checktype(L, 1, LUA_TTABLE);
+ i = luaL_optint(L, 2, 1);
+ e = luaL_opt(L, luaL_checkint, 3, luaL_getn(L, 1));
++ if (i > e) return 0; /* empty range */
+ n = e - i + 1; /* number of elements */
+- if (n <= 0) return 0; /* empty range */
+- luaL_checkstack(L, n, "table too big to unpack");
+- for (; i<=e; i++) /* push arg[i...e] */
++ if (n <= 0 || !lua_checkstack(L, n)) /* n <= 0 means arith. overflow */
++ return luaL_error(L, "too many results to unpack");
++ lua_rawgeti(L, 1, i); /* push arg[i] (avoiding overflow problems) */
++ while (i++ < e) /* push arg[i + 1...e] */
+ lua_rawgeti(L, 1, i);
+ return n;
+ }
More information about the arch-commits
mailing list