summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/l-md5.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/l-md5.lua')
-rw-r--r--Master/texmf-dist/tex/context/base/l-md5.lua7
1 files changed, 3 insertions, 4 deletions
diff --git a/Master/texmf-dist/tex/context/base/l-md5.lua b/Master/texmf-dist/tex/context/base/l-md5.lua
index 27955ef9b9e..1d471c966ca 100644
--- a/Master/texmf-dist/tex/context/base/l-md5.lua
+++ b/Master/texmf-dist/tex/context/base/l-md5.lua
@@ -7,6 +7,7 @@ if not modules then modules = { } end modules ['l-md5'] = {
-- This also provides file checksums and checkers.
+local md5, file = md5, file
local gsub, format, byte = string.gsub, string.format, string.byte
local function convert(str,fmt)
@@ -30,14 +31,12 @@ if not md5.dec then function md5.dec(str) return convert(str,"%03i") end end
--~ function md5.dec(str) return (gsub(md5.sum(str),".",remap)) end
--~ end
-file.needs_updating_threshold = 1
-
-function file.needs_updating(oldname,newname) -- size modification access change
+function file.needs_updating(oldname,newname,threshold) -- size modification access change
local oldtime = lfs.attributes(oldname, modification)
local newtime = lfs.attributes(newname, modification)
if newtime >= oldtime then
return false
- elseif oldtime - newtime < file.needs_updating_threshold then
+ elseif oldtime - newtime < (threshold or 1) then
return false
else
return true