aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichal Cichra <mikz@users.noreply.github.com>2017-09-26 10:59:38 +0200
committerGitHub <noreply@github.com>2017-09-26 10:59:38 +0200
commit2de11bd8d94951f2f4272dcef47b48d6c7d1d860 (patch)
tree08c5b87d7ef78e87b030149fc8cb7c3b7c1008f4 /src
parent147003f6176be5e0ee18011d8e72621fe4df86be (diff)
downloadluarocks-2de11bd8d94951f2f4272dcef47b48d6c7d1d860.tar.gz
luarocks-2de11bd8d94951f2f4272dcef47b48d6c7d1d860.tar.bz2
luarocks-2de11bd8d94951f2f4272dcef47b48d6c7d1d860.zip
read just one line when checking md5
in some cases reading the whole file fails (on macOS High Sierra, LuaJIT) this is timing dependent and waiting between spawning and reading solves the issue as well
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/fs/tools.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/luarocks/fs/tools.lua b/src/luarocks/fs/tools.lua
index 16dc9cf2..991c25cb 100644
--- a/src/luarocks/fs/tools.lua
+++ b/src/luarocks/fs/tools.lua
@@ -144,7 +144,7 @@ function tools.get_md5(file)
144 local cmd = md5_cmd[cfg.md5checker] 144 local cmd = md5_cmd[cfg.md5checker]
145 if not cmd then return nil, "no MD5 checker command configured" end 145 if not cmd then return nil, "no MD5 checker command configured" end
146 local pipe = io.popen(cmd.." "..fs.Q(fs.absolute_name(file))) 146 local pipe = io.popen(cmd.." "..fs.Q(fs.absolute_name(file)))
147 local computed = pipe:read("*a") 147 local computed = pipe:read("*l")
148 pipe:close() 148 pipe:close()
149 if computed then 149 if computed then
150 computed = computed:match("("..("%x"):rep(32)..")") 150 computed = computed:match("("..("%x"):rep(32)..")")