OSDN Git Service

lualibs-gzip to lualibs-util-zip
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Wed, 5 Oct 2022 23:18:09 +0000 (08:18 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Wed, 5 Oct 2022 23:18:09 +0000 (08:18 +0900)
src/ltj-base.lua

index 41caef5..4a95616 100644 (file)
@@ -226,9 +226,12 @@ end
 --   But sometimes we want to create only the precompiled cache,
 --   when its 'text' version is already present in LuaTeX-ja distribution.
 
-require('lualibs-lpeg') -- string.split
-require('lualibs-os')   -- os.type
-require('lualibs-gzip') -- gzip.*
+if not os.type then require'lualibs-os' end
+if not string.split then  require'lualibs-lpeg' end
+if not gzip then
+  if kpse.find_file('lualibs-util-zip', 'lua') then require'lualibs-util-zip' 
+  else require'lualibs-gzip' end
+end
 
 do
    local kpse_var_value = kpse.var_value