diff options
author | Hans Hagen <pragma@wxs.nl> | 2019-08-24 23:32:35 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2019-08-24 23:32:35 +0200 |
commit | fca2d946bc4d3ef525c3a2c9016e3b88d6d09812 (patch) | |
tree | d0fb4d8a17342fcf08a4b033cf61a47fd6e0aa98 /scripts | |
parent | f6e7648f6126ffe087071531f03c674be32930f1 (diff) | |
download | context-fca2d946bc4d3ef525c3a2c9016e3b88d6d09812.tar.gz |
2019-08-24 22:49:00
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/context/lua/mtx-install.lua | 14 |
1 files changed, 8 insertions, 6 deletions
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)) |