Changeset 15109


Ignore:
Timestamp:
2009-04-05T04:33:41+02:00 (9 years ago)
Author:
jow
Message:

[package] lua: add zlib build dependency, fix inaccuracy in gzip loader

Location:
trunk/package/lua
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/lua/Makefile

    r15108 r15109  
    2121 
    2222HOST_PATCH_DIR=./patches-host 
    23 PKG_BUILD_DEPENDS:=lua/host 
     23PKG_BUILD_DEPENDS:=lua/host zlib 
    2424 
    2525include $(INCLUDE_DIR)/host-build.mk 
  • trunk/package/lua/patches-host/040-gzip-source-loader.patch

    r15108 r15109  
    1313diff -ur lua-5.1.4.orig/src/lauxlib.c lua-5.1.4/src/lauxlib.c 
    1414--- lua-5.1.4.orig/src/lauxlib.c        2009-04-04 23:06:04.000000000 +0200 
    15 +++ lua-5.1.4/src/lauxlib.c     2009-04-05 00:03:33.000000000 +0200 
     15+++ lua-5.1.4/src/lauxlib.c     2009-04-05 03:35:24.000000000 +0200 
    1616@@ -11,6 +11,7 @@ 
    1717 #include <stdio.h> 
     
    3535 static const char *getF (lua_State *L, void *ud, size_t *size) { 
    3636   LoadF *lf = (LoadF *)ud; 
    37 @@ -550,6 +557,26 @@ 
     37@@ -550,6 +557,28 @@ 
    3838 } 
    3939  
     
    4848+    if (lf->first_chunk) { 
    4949+      lf->first_chunk = 0; 
    50 +      if (strstr(lf->buffer, "#!") && (sp=strstr(lf->buffer, "\n")) != NULL) { 
     50+      if ((lf->buffer[0] == '#') && (lf->buffer[1] == '!') && 
     51+          (sp=strstr(lf->buffer, "\n")) != NULL) 
     52+      { 
    5153+        *size -= ((uint)sp - (uint)lf->buffer); 
    5254+        return sp; 
     
    6264   const char *serr = strerror(errno); 
    6365   const char *filename = lua_tostring(L, fnameindex) + 1; 
    64 @@ -560,6 +587,31 @@ 
     66@@ -560,6 +589,31 @@ 
    6567  
    6668  
  • trunk/package/lua/patches/040-gzip-source-loader.patch

    r15108 r15109  
    1313diff -ur lua-5.1.4.orig/src/lauxlib.c lua-5.1.4/src/lauxlib.c 
    1414--- lua-5.1.4.orig/src/lauxlib.c        2009-04-04 23:06:04.000000000 +0200 
    15 +++ lua-5.1.4/src/lauxlib.c     2009-04-05 00:03:33.000000000 +0200 
     15+++ lua-5.1.4/src/lauxlib.c     2009-04-05 03:35:24.000000000 +0200 
    1616@@ -11,6 +11,7 @@ 
    1717 #include <stdio.h> 
     
    3535 static const char *getF (lua_State *L, void *ud, size_t *size) { 
    3636   LoadF *lf = (LoadF *)ud; 
    37 @@ -550,6 +557,26 @@ 
     37@@ -550,6 +557,28 @@ 
    3838 } 
    3939  
     
    4848+    if (lf->first_chunk) { 
    4949+      lf->first_chunk = 0; 
    50 +      if (strstr(lf->buffer, "#!") && (sp=strstr(lf->buffer, "\n")) != NULL) { 
     50+      if ((lf->buffer[0] == '#') && (lf->buffer[1] == '!') && 
     51+          (sp=strstr(lf->buffer, "\n")) != NULL) 
     52+      { 
    5153+        *size -= ((uint)sp - (uint)lf->buffer); 
    5254+        return sp; 
     
    6264   const char *serr = strerror(errno); 
    6365   const char *filename = lua_tostring(L, fnameindex) + 1; 
    64 @@ -560,6 +587,31 @@ 
     66@@ -560,6 +589,31 @@ 
    6567  
    6668  
Note: See TracChangeset for help on using the changeset viewer.