diff options
author | Karl Berry <karl@freefriends.org> | 2021-08-14 20:49:46 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-08-14 20:49:46 +0000 |
commit | d4424601e554a08fb8666350f6aad3cf6486fc92 (patch) | |
tree | 35c262e0f94f9afdc1898a43c517686736b4e609 /Build | |
parent | 7957729c657298312dd704a7cd42bef27ec9be27 (diff) |
xindex (14aug21)
git-svn-id: svn://tug.org/texlive/trunk@60242 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rwxr-xr-x | Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl | 10 | ||||
-rwxr-xr-x | Build/source/texk/texlive/linked_scripts/xindex/xindex.lua | 93 |
2 files changed, 65 insertions, 38 deletions
diff --git a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl index 7f05bde595e..c3fce2f2678 100755 --- a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl +++ b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl @@ -1,12 +1,12 @@ #!/usr/bin/env perl -# $Id: tlmgr.pl 59637 2021-06-19 15:17:38Z karl $ +# $Id: tlmgr.pl 60157 2021-08-04 01:42:52Z preining $ # # Copyright 2008-2021 Norbert Preining # This file is licensed under the GNU General Public License version 2 # or any later version. -my $svnrev = '$Revision: 59637 $'; -my $datrev = '$Date: 2021-06-19 17:17:38 +0200 (Sat, 19 Jun 2021) $'; +my $svnrev = '$Revision: 60157 $'; +my $datrev = '$Date: 2021-08-04 03:42:52 +0200 (Wed, 04 Aug 2021) $'; my $tlmgrrevision; my $tlmgrversion; my $prg; @@ -6465,7 +6465,7 @@ sub texconfig_conf_mimic { } info("=========================== active config files ==========================\n"); for my $m (sort(qw/fmtutil.cnf config.ps mktex.cnf pdftexconfig.tex/)) { - info(sprintf("%-17s %s", "$m:", `kpsewhich $m`)); + info(sprintf("%-17s %s", "$m:", `kpsewhich $m` || "(not found!)\n")); } for my $m (qw/texmf.cnf updmap.cfg/) { for my $f (`kpsewhich -all $m`) { @@ -10231,7 +10231,7 @@ This script and its documentation were written for the TeX Live distribution (L<https://tug.org/texlive>) and both are licensed under the GNU General Public License Version 2 or later. -$Id: tlmgr.pl 59637 2021-06-19 15:17:38Z karl $ +$Id: tlmgr.pl 60157 2021-08-04 01:42:52Z preining $ =cut # test HTML version: pod2html --cachedir=/tmp tlmgr.pl >/tmp/tlmgr.html diff --git a/Build/source/texk/texlive/linked_scripts/xindex/xindex.lua b/Build/source/texk/texlive/linked_scripts/xindex/xindex.lua index fdcbfb21724..3a9655c61d5 100755 --- a/Build/source/texk/texlive/linked_scripts/xindex/xindex.lua +++ b/Build/source/texk/texlive/linked_scripts/xindex/xindex.lua @@ -6,11 +6,11 @@ -- AUTHOR: Herbert Voß -- LICENSE: LPPL 1.3 -- --- $Id: xindex.lua 4 2021-07-07 07:25:04Z hvoss $ +-- $Id: xindex.lua 10 2021-08-14 07:50:17Z hvoss $ ----------------------------------------------------------------------- xindex = xindex or { } - local version = 0.30 + local version = 0.31 xindex.version = version --xindex.self = "xindex" @@ -32,13 +32,13 @@ Report bugs to kpse.set_program_name("luatex") local f = kpse.find_file("lualibs.lua") -print ("filename "..f) +--print ("filename "..f) + require("lualibs") -- all part of LuaTeX require('unicode') require('string') require("lpeg") - local args = require ('xindex-lapp') [[ parameter handling -q,--quiet @@ -53,10 +53,10 @@ local args = require ('xindex-lapp') [[ -l,--language (default en) -p,--prefix (default L) -u,--use_UCA - <input> (string) + -s,--use_stdin + <files...> (default stdin) .idx file(s) ]] - --[[ No -v flag, v is just { false }. not args.v[1] is true, so vlevel becomes 0. One -v flags, v is { true } @@ -76,6 +76,8 @@ if (luaVersion < "Lua 5.3") then os.exit() end +useStdInput = args["use_stdin"] + --local inspect = require 'inspect' --print(inspect(args)) @@ -91,46 +93,70 @@ be no log file created. end ]] - ---[[ -if not args["input"] then - io.write ("Filename: ") - inFile = io.read() -else - inFile = args["input"] +require('xindex-baselib') + +local nInFiles = #args.files +if not useStdInput then + --print(tostring(nInFiles).." input files are given!") + inFiles = {} --args.files as strings + for i = 1,nInFiles do + local file = args.files_name[i] +-- test for extension is in xindex-lapp +-- if not file_exists(file) then +-- if file_exists(file..".idx") then +-- inFiles[#inFiles+1] = file..".idx" +-- else +-- print("Inputfile "..file.." or "..file..".idx not found!\n") +-- end +-- else + inFiles[#inFiles+1] = file +-- end + end end -]] -require('xindex-lib') - -inFile = args["input"] -if not file_exists(inFile) then - if file_exists(inFile..".idx") then - inFile = inFile..".idx" - else - writeLog(2,"Inputfile "..inFile.." or "..inFile..".idx not found!\n",0) - os.exit() - end -end +-- print ("Check Logfile:") local filename -local logfilename +logfilename = "" + if args["output"] == '""' then - if inFile:sub(inFile:len()-3,inFile:len()) == ".idx" then - filename = inFile:sub(1,inFile:len()-3).."ind" - logfilename = inFile:sub(1,inFile:len()-3).."ilg" + if not useStdInput then + if inFiles[1]:sub(inFiles[1]:len()-3,inFiles[1]:len()) == ".idx" then + filename = inFiles[1]:sub(1,inFiles[1]:len()-3).."ind" + if nInFiles > 1 then + logfilename = "xindex.ilg" + else + logfilename = inFiles[1]:sub(1,inFiles[1]:len()-3).."ilg" + end + else + filename = inFiles[1]..".ind" + if nInFiles > 1 then + logfilename = "xindex.ilg" + else + logfilename = inFiles[1]..".ilg" + end + end else - filename = inFile..".ind" - logfilename = inFile..".ilg" + filename = "xindex.ind" + logfilename = "xindex.ilg" end else filename = args.output - logfilename = filename:gsub('%p...','')..".ilg" + if nInFiles > 1 or useStdInput then + logfilename = "xindex.ilg" + else + logfilename = filename:gsub('%p...','')..".ilg" + end end + + logFile = io.open(logfilename,"w+") +require('xindex-lib') + writeLog(2,"xindex v."..version.." (c) Herbert Voß\n",-1) writeLog(1,"Verbose level = "..vlevel.."\n",1) +writeLog(2,"Logfile:",logfilename,1) writeLog(2,"Open outputfile "..filename,0) outFile = io.open(filename,"w+") @@ -147,7 +173,7 @@ if vlevel > 0 then writeLog(1,"---------- parameter ----------\n",1) end -writeLog(2,"Using input file: "..inFile.."\n",0) +-- writeLog(2,"Using input file: "..inFile.."\n",0) labelPrefix = args.prefix writeLog(2,"Label prefix: "..labelPrefix.."\n",-1) @@ -254,6 +280,7 @@ outFile = io.open(filename,"w+") writeLog(2,"... done\n",0) writeLog(1,"Starting base file ... \n",2) + BaseRunFile = kpse.find_file("xindex-base.lua") dofile(BaseRunFile) |