From 4b089e589d39346a66a27d04f9857fe16e4b7b41 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Thu, 19 Nov 2020 11:48:53 +0100 Subject: 2020-11-19 11:26:00 --- scripts/context/lua/mtx-install.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 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 eba8dd5c9..1c9c29f71 100644 --- a/scripts/context/lua/mtx-install.lua +++ b/scripts/context/lua/mtx-install.lua @@ -152,11 +152,16 @@ function install.identify() 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 + local data = io.loaddata(name) + if data and #data > 0 then + local stamp = hashdata(data) + details[i] = { base, size, stamp } + total = total + size + else + report("%-24s : bad file %a",tree,name) + end end - report("%-20s : %4i files, %3.0f MB",tree,#files,total/(1000*1000)) + report("%-24s : %4i files, %3.0f MB",tree,#files,total/(1000*1000)) savetable(path .. ".tma",details) -- cgit v1.2.3