From 3f60bec6a04eabfe1e86547f49708ea33b319849 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(-) (limited to 'src') diff --git a/src/luarocks/fs/tools.lua b/src/luarocks/fs/tools.lua index 60d1d9ff..fc319af9 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