diff options
-rwxr-xr-x | Master/tlpkg/texlua/mktexupd.texlua | 41 |
1 files changed, 18 insertions, 23 deletions
diff --git a/Master/tlpkg/texlua/mktexupd.texlua b/Master/tlpkg/texlua/mktexupd.texlua index a85bdb9b6ef..13bb58771ad 100755 --- a/Master/tlpkg/texlua/mktexupd.texlua +++ b/Master/tlpkg/texlua/mktexupd.texlua @@ -1,14 +1,13 @@ #!/usr/bin/env texlua ---[[ Written in lua by Norbert Preining (2008) based on the shell script by -Thomas Esser. -Copyright 2008 Norbert Preining -License: GPL -]] +-- Written in lua by Norbert Preining (2008) based on the shell script by +-- Thomas Esser. +-- Copyright 2008 Norbert Preining +-- License: GPL ---[[ Changelog - 0.1 - - first initial version -]] + +-- Changelog +-- 0.1 +-- - first initial version progname = 'mktexupd (texlua version)'; version = '0.1'; @@ -42,7 +41,7 @@ if not arg[2] then return end ---[[ initialize kpathsea ]] +-- initialize kpathsea kpse.set_program_name("mktexupd") dir = arg[1] @@ -56,12 +55,10 @@ if (not lfs.isfile(fullfile)) then die (progname .. ': ' .. fullfile .. ' not a file.\n') end ---[[ --- we have to get the list of all directories where ls-R files are present --- using TEXMFDBS. In the shell code `kpsewhich -show-path=ls-R was used --- we do it with kpse.expand_braces("$TEXMFDBS") and then split at : and --- remove the !! ---]] +-- we have to get the list of all directories where ls-R files are present +-- using TEXMFDBS. In the shell code `kpsewhich -show-path=ls-R was used +-- we do it with kpse.expand_braces("$TEXMFDBS") and then split at : and +-- remove the !! texmfdbs = kpse.expand_braces("$TEXMFDBS") for d in string.gmatch(texmfdbs,"[^:]+") do @@ -92,12 +89,12 @@ if (not(lfs.isfile(db_file))) then os.exit() end +-- Old ls-R files should continue to work. ls_R_magic = '% ls-R -- filename database for kpathsea; do not change this line.' ---[[ Old ls-R files should continue to work. ]] old_ls_R_magic='% ls-R -- maintained by MakeTeXls-R; do not change this line.' ---[[ read first line of ls-R file ]] +-- read first line of ls-R file lsrfh = io.open(db_file) if (not(lsrfh)) then die('that should not happen ...\n') @@ -111,16 +108,14 @@ if (firstline ~= ls_R_magic) then end end ---[[ ok we are that far, try to open the file for writing ]] +-- ok we are that far, try to open the file for writing lsrfh,erro = io.open(db_file,"a+") if (not(lsrfh)) then die(progname..': cannot open '..db_file..' for writing: '..erro..'\n') end ---[[ --- May as well always put in a new directory entry; presumably cron will --- come along soon enough and clean things up. ---]] +-- May as well always put in a new directory entry; presumably cron will +-- come along soon enough and clean things up. lsrfh:write('./'..pathcomponent..':\n') lsrfh:write(file..'\n') io.close(lsrfh) |