aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2011-07-06 12:22:34 -0700
committerHisham Muhammad <hisham@gobolinux.org>2011-07-06 12:22:34 -0700
commit319d49cb89b8b830336a955f233e2a27b7841996 (patch)
treefa65d86f0d9c3e21aace6ca4dbc7807af79eee89
parent5a7a71236d9119befa1935c94ca8bb80b862626c (diff)
parentcf952ba5e16b7ac85c361db1333d86484ce4a47a (diff)
downloadluarocks-319d49cb89b8b830336a955f233e2a27b7841996.tar.gz
luarocks-319d49cb89b8b830336a955f233e2a27b7841996.tar.bz2
luarocks-319d49cb89b8b830336a955f233e2a27b7841996.zip
Merge pull request #29 from ignacio/master
Luarocks fails to pack some large rocks when lzlib is installed
-rw-r--r--src/luarocks/tools/zip.lua8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/luarocks/tools/zip.lua b/src/luarocks/tools/zip.lua
index caeb4ac9..36adc7e2 100644
--- a/src/luarocks/tools/zip.lua
+++ b/src/luarocks/tools/zip.lua
@@ -5,8 +5,6 @@ local zlib = require("zlib")
5local fs = require("luarocks.fs") 5local fs = require("luarocks.fs")
6local dir = require("luarocks.dir") 6local dir = require("luarocks.dir")
7 7
8local size_buf = 65535
9
10local function number_to_bytestring(number, nbytes) 8local function number_to_bytestring(number, nbytes)
11 local out = {} 9 local out = {}
12 for i = 1, nbytes do 10 for i = 1, nbytes do
@@ -115,8 +113,8 @@ local function zipwriter_add(self, file)
115 err = "error opening "..file.." for reading" 113 err = "error opening "..file.." for reading"
116 end 114 end
117 end 115 end
118 while ok do 116 if ok then
119 local buf = fin:read(size_buf) 117 local buf = fin:read("*a")
120 if not buf then 118 if not buf then
121 break 119 break
122 end 120 end
@@ -190,7 +188,7 @@ function new_zipwriter(name)
190 188
191 local zw = {} 189 local zw = {}
192 190
193 zw.ziphandle = io.open(name, "w") 191 zw.ziphandle = io.open(name, "wb")
194 if not zw.ziphandle then 192 if not zw.ziphandle then
195 return nil 193 return nil
196 end 194 end