[79394] trunk/dports/lang/lua

jeremyhu at macports.org jeremyhu at macports.org
Sun Jun 12 13:15:37 PDT 2011


Revision: 79394
          http://trac.macports.org/changeset/79394
Author:   jeremyhu at macports.org
Date:     2011-06-12 13:15:36 -0700 (Sun, 12 Jun 2011)
Log Message:
-----------
lua: Fix patching regression introduced by r77868

Revision Links:
--------------
    http://trac.macports.org/changeset/77868

Modified Paths:
--------------
    trunk/dports/lang/lua/Portfile
    trunk/dports/lang/lua/files/patch-Makefile.diff
    trunk/dports/lang/lua/files/patch-src_Makefile.diff

Added Paths:
-----------
    trunk/dports/lang/lua/files/patch-lua-5.1.4-3

Modified: trunk/dports/lang/lua/Portfile
===================================================================
--- trunk/dports/lang/lua/Portfile	2011-06-12 20:05:47 UTC (rev 79393)
+++ trunk/dports/lang/lua/Portfile	2011-06-12 20:15:36 UTC (rev 79394)
@@ -21,10 +21,7 @@
 
 checksums           ${distfiles} \
                     sha1    2b11c8e60306efb7f0734b747588f57995493db7 \
-                    rmd160  c867c8364295d3e4fb4e4d8ebb27fa2b2312cdef \
-                    patch-lua-5.1.4-3 \
-                    sha1    312d5baf480aa4c61cdc212dcbd10322f020c198 \
-                    rmd160  8361d74d2b6d1f7a53eaa9943dd5c4f2f3b892b9
+                    rmd160  c867c8364295d3e4fb4e4d8ebb27fa2b2312cdef
 
 depends_lib         port:readline
 build.target        macosx
@@ -32,7 +29,6 @@
 test.run            yes
 test.env            DYLD_LIBRARY_PATH=./lib
 
-patch.dir           ${worksrcpath}/src
 patchfiles          patch-lua-5.1.4-3 \
                     patch-Makefile.diff \
                     patch-src_Makefile.diff

Modified: trunk/dports/lang/lua/files/patch-Makefile.diff
===================================================================
--- trunk/dports/lang/lua/files/patch-Makefile.diff	2011-06-12 20:05:47 UTC (rev 79393)
+++ trunk/dports/lang/lua/files/patch-Makefile.diff	2011-06-12 20:15:36 UTC (rev 79394)
@@ -1,5 +1,5 @@
---- ../Makefile.orig	2011-03-27 16:49:40.000000000 +0200
-+++ ../Makefile	2011-03-27 16:52:46.000000000 +0200
+--- Makefile.orig	2011-03-27 16:49:40.000000000 +0200
++++ Makefile	2011-03-27 16:52:46.000000000 +0200
 @@ -43,7 +43,7 @@
  # What to install.
  TO_BIN= lua luac

Added: trunk/dports/lang/lua/files/patch-lua-5.1.4-3
===================================================================
--- trunk/dports/lang/lua/files/patch-lua-5.1.4-3	                        (rev 0)
+++ trunk/dports/lang/lua/files/patch-lua-5.1.4-3	2011-06-12 20:15:36 UTC (rev 79394)
@@ -0,0 +1,172 @@
+# patch-lua-5.1.4-3 created 2011-03-16T19:06:31-0300
+# apply to a pristine copy of Lua 5.1.4 with:
+#	wget http://www.lua.org/ftp/lua-5.1.4.tar.gz
+#	tar zxf lua-5.1.4.tar.gz
+#	cd lua-5.1.4/src
+#	wget http://www.lua.org/ftp/patch-lua-5.1.4-3
+#	patch < patch-lua-5.1.4-3
+# use curl -O -R if you don't have wget
+
+--- src/lcode.c	2007/12/28 15:32:23	2.25.1.3
++++ src/lcode.c	2011/01/31 14:53:16	2.25.1.5
+@@ -1,5 +1,5 @@
+ /*
+-** $Id: lcode.c,v 2.25.1.3 2007/12/28 15:32:23 roberto Exp $
++** $Id: lcode.c,v 2.25.1.5 2011/01/31 14:53:16 roberto Exp $
+ ** Code generator for Lua
+ ** See Copyright Notice in lua.h
+ */
+@@ -544,10 +544,6 @@
+       pc = NO_JUMP;  /* always true; do nothing */
+       break;
+     }
+-    case VFALSE: {
+-      pc = luaK_jump(fs);  /* always jump */
+-      break;
+-    }
+     case VJMP: {
+       invertjump(fs, e);
+       pc = e->u.s.info;
+@@ -572,10 +568,6 @@
+       pc = NO_JUMP;  /* always false; do nothing */
+       break;
+     }
+-    case VTRUE: {
+-      pc = luaK_jump(fs);  /* always jump */
+-      break;
+-    }
+     case VJMP: {
+       pc = e->u.s.info;
+       break;
+--- src/ldblib.c	2008/01/21 13:11:21	1.104.1.3
++++ src/ldblib.c	2009/08/04 18:50:18	1.104.1.4
+@@ -1,5 +1,5 @@
+ /*
+-** $Id: ldblib.c,v 1.104.1.3 2008/01/21 13:11:21 roberto Exp $
++** $Id: ldblib.c,v 1.104.1.4 2009/08/04 18:50:18 roberto Exp $
+ ** Interface from Lua to its debug API
+ ** See Copyright Notice in lua.h
+ */
+@@ -45,6 +45,7 @@
+ 
+ 
+ static int db_getfenv (lua_State *L) {
++  luaL_checkany(L, 1);
+   lua_getfenv(L, 1);
+   return 1;
+ }
+--- src/liolib.c	2008/01/18 17:47:43	2.73.1.3
++++ src/liolib.c	2010/05/14 15:33:51	2.73.1.4
+@@ -1,5 +1,5 @@
+ /*
+-** $Id: liolib.c,v 2.73.1.3 2008/01/18 17:47:43 roberto Exp $
++** $Id: liolib.c,v 2.73.1.4 2010/05/14 15:33:51 roberto Exp $
+ ** Standard I/O (and system) library
+ ** See Copyright Notice in lua.h
+ */
+@@ -276,7 +276,10 @@
+     lua_pushnumber(L, d);
+     return 1;
+   }
+-  else return 0;  /* read fails */
++  else {
++    lua_pushnil(L);  /* "result" to be removed */
++    return 0;  /* read fails */
++  }
+ }
+ 
+ 
+--- src/llex.c	2007/12/27 13:02:25	2.20.1.1
++++ src/llex.c	2009/11/23 14:58:22	2.20.1.2
+@@ -1,5 +1,5 @@
+ /*
+-** $Id: llex.c,v 2.20.1.1 2007/12/27 13:02:25 roberto Exp $
++** $Id: llex.c,v 2.20.1.2 2009/11/23 14:58:22 roberto Exp $
+ ** Lexical Analyzer
+ ** See Copyright Notice in lua.h
+ */
+@@ -118,8 +118,10 @@
+   lua_State *L = ls->L;
+   TString *ts = luaS_newlstr(L, str, l);
+   TValue *o = luaH_setstr(L, ls->fs->h, ts);  /* entry for `str' */
+-  if (ttisnil(o))
++  if (ttisnil(o)) {
+     setbvalue(o, 1);  /* make sure `str' will not be collected */
++    luaC_checkGC(L);
++  }
+   return ts;
+ }
+ 
+--- src/loadlib.c	2008/08/06 13:29:28	1.52.1.3
++++ src/loadlib.c	2009/09/09 13:17:16	1.52.1.4
+@@ -1,5 +1,5 @@
+ /*
+-** $Id: loadlib.c,v 1.52.1.3 2008/08/06 13:29:28 roberto Exp $
++** $Id: loadlib.c,v 1.52.1.4 2009/09/09 13:17:16 roberto Exp $
+ ** Dynamic library loader for Lua
+ ** See Copyright Notice in lua.h
+ **
+@@ -639,7 +639,7 @@
+   lua_pushvalue(L, -1);
+   lua_replace(L, LUA_ENVIRONINDEX);
+   /* create `loaders' table */
+-  lua_createtable(L, 0, sizeof(loaders)/sizeof(loaders[0]) - 1);
++  lua_createtable(L, sizeof(loaders)/sizeof(loaders[0]) - 1, 0);
+   /* fill it with pre-defined loaders */
+   for (i=0; loaders[i] != NULL; i++) {
+     lua_pushcfunction(L, loaders[i]);
+--- src/lstrlib.c	2008/07/11 17:27:21	1.132.1.4
++++ src/lstrlib.c	2010/05/14 15:34:19	1.132.1.5
+@@ -1,5 +1,5 @@
+ /*
+-** $Id: lstrlib.c,v 1.132.1.4 2008/07/11 17:27:21 roberto Exp $
++** $Id: lstrlib.c,v 1.132.1.5 2010/05/14 15:34:19 roberto Exp $
+ ** Standard library for string operations and pattern-matching
+ ** See Copyright Notice in lua.h
+ */
+@@ -754,6 +754,7 @@
+ 
+ 
+ static int str_format (lua_State *L) {
++  int top = lua_gettop(L);
+   int arg = 1;
+   size_t sfl;
+   const char *strfrmt = luaL_checklstring(L, arg, &sfl);
+@@ -768,7 +769,8 @@
+     else { /* format item */
+       char form[MAX_FORMAT];  /* to store the format (`%...') */
+       char buff[MAX_ITEM];  /* to store the formatted item */
+-      arg++;
++      if (++arg > top)
++        luaL_argerror(L, arg, "no value");
+       strfrmt = scanformat(L, strfrmt, form);
+       switch (*strfrmt++) {
+         case 'c': {
+--- src/lvm.c	2007/12/28 15:32:23	2.63.1.3
++++ src/lvm.c	2009/07/01 21:10:33	2.63.1.4
+@@ -1,5 +1,5 @@
+ /*
+-** $Id: lvm.c,v 2.63.1.3 2007/12/28 15:32:23 roberto Exp $
++** $Id: lvm.c,v 2.63.1.4 2009/07/01 21:10:33 roberto Exp $
+ ** Lua virtual machine
+ ** See Copyright Notice in lua.h
+ */
+@@ -133,6 +133,7 @@
+ 
+ void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) {
+   int loop;
++  TValue temp;
+   for (loop = 0; loop < MAXTAGLOOP; loop++) {
+     const TValue *tm;
+     if (ttistable(t)) {  /* `t' is a table? */
+@@ -152,7 +153,9 @@
+       callTM(L, tm, t, key, val);
+       return;
+     }
+-    t = tm;  /* else repeat with `tm' */ 
++    /* else repeat with `tm' */
++    setobj(L, &temp, tm);  /* avoid pointing inside table (may rehash) */
++    t = &temp;
+   }
+   luaG_runerror(L, "loop in settable");
+ }

Modified: trunk/dports/lang/lua/files/patch-src_Makefile.diff
===================================================================
--- trunk/dports/lang/lua/files/patch-src_Makefile.diff	2011-06-12 20:05:47 UTC (rev 79393)
+++ trunk/dports/lang/lua/files/patch-src_Makefile.diff	2011-06-12 20:15:36 UTC (rev 79394)
@@ -1,5 +1,5 @@
---- Makefile.orig	2011-03-27 16:49:54.000000000 +0200
-+++ Makefile	2011-03-27 16:55:30.000000000 +0200
+--- src/Makefile.orig	2011-03-27 16:49:54.000000000 +0200
++++ src/Makefile	2011-03-27 16:55:30.000000000 +0200
 @@ -23,6 +23,7 @@
  PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110612/508e9914/attachment-0001.html>


More information about the macports-changes mailing list