From 2de11bd8d94951f2f4272dcef47b48d6c7d1d860 Mon Sep 17 00:00:00 2001 From: Michal Cichra Date: Tue, 26 Sep 2017 10:59:38 +0200 Subject: 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 --- src/luarocks/fs/tools.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) local cmd = md5_cmd[cfg.md5checker] if not cmd then return nil, "no MD5 checker command configured" end local pipe = io.popen(cmd.." "..fs.Q(fs.absolute_name(file))) - local computed = pipe:read("*a") + local computed = pipe:read("*l") pipe:close() if computed then computed = computed:match("("..("%x"):rep(32)..")") -- cgit v1.2.3-55-g6feb