From fca2d946bc4d3ef525c3a2c9016e3b88d6d09812 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Sat, 24 Aug 2019 23:32:35 +0200 Subject: 2019-08-24 22:49:00 --- scripts/context/lua/mtx-install.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'scripts/context/lua/mtx-install.lua') diff --git a/scripts/context/lua/mtx-install.lua b/scripts/context/lua/mtx-install.lua index 66f1556c9..bad5c8393 100644 --- a/scripts/context/lua/mtx-install.lua +++ b/scripts/context/lua/mtx-install.lua @@ -127,6 +127,8 @@ function install.identify() -- We have to be in "...../tex" where subdirectories are prefixed with -- "texmf". We strip the "tex/texm*/" from the name in the list. + local hashdata = sha2 and sha2.HASH256 or md5.hex + local function collect(root,tree) local path = root .. "/" .. tree @@ -141,12 +143,12 @@ function install.identify() local total = 0 for i=1,#files do - local name = files[i] - local size = filesize(name) - local base = gsub(name,pattern,"") - local stamp = md5.hex(io.loaddata(name)) - details[i] = { base, size, stamp } - total = total + size + local name = files[i] + local size = filesize(name) + local base = gsub(name,pattern,"") + local stamp = hashdata(io.loaddata(name)) + details[i] = { base, size, stamp } + total = total + size end report("%-20s : %4i files, %3.0f MB",tree,#files,total/(1000*1000)) -- cgit v1.2.3