texlive[66799] Master/texmf-dist/tex/context/texlive: Update

commits+preining at tug.org commits+preining at tug.org
Sat Apr 8 02:15:29 CEST 2023


Revision: 66799
          http://tug.org/svn/texlive?view=revision&revision=66799
Author:   preining
Date:     2023-04-08 02:15:29 +0200 (Sat, 08 Apr 2023)
Log Message:
-----------
Update cont-sys.mkxl, add .mkiv

Modified Paths:
--------------
    trunk/Master/texmf-dist/tex/context/texlive/cont-sys.mkxl

Added Paths:
-----------
    trunk/Master/texmf-dist/tex/context/texlive/cont-sys.mkiv

Copied: trunk/Master/texmf-dist/tex/context/texlive/cont-sys.mkiv (from rev 66798, trunk/Master/texmf-dist/tex/context/texlive/cont-sys.mkxl)
===================================================================
--- trunk/Master/texmf-dist/tex/context/texlive/cont-sys.mkiv	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/context/texlive/cont-sys.mkiv	2023-04-08 00:15:29 UTC (rev 66799)
@@ -0,0 +1,34 @@
+% Update the ConTeXt filename cache if the system ls-R files are modified
+\startluacode
+    local addsuffix = file.addsuffix
+    local attributes = lfs.attributes
+    local difftime = os.difftime
+    local file_join = file.join
+    local getfirstreadablefile = caches.getfirstreadablefile
+    local gethashes = resolvers.gethashes
+    local hashed = caches.hashed
+    local ipairs = ipairs
+    local resolve = resolvers.resolve
+
+    local stale = false
+    for _, tree in ipairs(gethashes()) do
+        local lsR_path = file_join(resolve(tree.name), "ls-R")
+        local lsR_time = attributes(lsR_path, "modification")
+
+        local hash = hashed(tree.name)
+        local hash_path = getfirstreadablefile(addsuffix(hash, "lua"), "trees")
+        local hash_time = attributes(hash_path, "modification")
+
+        if lsR_time and hash_time and difftime(lsR_time, hash_time) > 0 then
+            stale = true
+        end
+    end
+
+    if stale then
+        resolvers.renewcache()
+        resolvers.load()
+    end
+\stopluacode
+
+% % Set the default paper size
+\readsysfile{context-papersize.tex}{}{}

Modified: trunk/Master/texmf-dist/tex/context/texlive/cont-sys.mkxl
===================================================================
--- trunk/Master/texmf-dist/tex/context/texlive/cont-sys.mkxl	2023-04-08 00:15:21 UTC (rev 66798)
+++ trunk/Master/texmf-dist/tex/context/texlive/cont-sys.mkxl	2023-04-08 00:15:29 UTC (rev 66799)
@@ -8,10 +8,7 @@
     local gethashes = resolvers.gethashes
     local hashed = caches.hashed
     local ipairs = ipairs
-    local pcall = pcall
     local resolve = resolvers.resolve
-    local time = os.time
-    local totime = utilities.parsers.totime
 
     local stale = false
     for _, tree in ipairs(gethashes()) do
@@ -19,18 +16,9 @@
         local lsR_time = attributes(lsR_path, "modification")
 
         local hash = hashed(tree.name)
-        local path = getfirstreadablefile(addsuffix(hash, "lua"), "trees")
+        local hash_path = getfirstreadablefile(addsuffix(hash, "lua"), "trees")
+        local hash_time = attributes(hash_path, "modification")
 
-        local state, blob = pcall(loadfile, path)
-        local hash_time
-
-        if blob then
-            local data = blob()
-            if data then
-                hash_time = time(totime(data.date .. " " .. data.time))
-            end
-        end
-
         if lsR_time and hash_time and difftime(lsR_time, hash_time) > 0 then
             stale = true
         end
@@ -42,5 +30,5 @@
     end
 \stopluacode
 
-% Set the default paper size
+% % Set the default paper size
 \readsysfile{context-papersize.tex}{}{}



More information about the tex-live-commits mailing list.