From af9b6adea174feb643b34bbf11b795ba9185f4ef Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Tue, 22 Jul 2008 08:58:59 +0000 Subject: tlpdb.tlu: support reading docfile tags from tlpdb git-svn-id: svn://tug.org/texlive/trunk@9699 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf/scripts/texlive/lua/texlive/tlpdb.tlu | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'Master') diff --git a/Master/texmf/scripts/texlive/lua/texlive/tlpdb.tlu b/Master/texmf/scripts/texlive/lua/texlive/tlpdb.tlu index 39502a4007d..9722c078704 100644 --- a/Master/texmf/scripts/texlive/lua/texlive/tlpdb.tlu +++ b/Master/texmf/scripts/texlive/lua/texlive/tlpdb.tlu @@ -28,6 +28,7 @@ -- tlpobj.binfiles table indexed by archs giving table indexed by numbers -- tlpobj.binsize table indexed by archs giving strings -- tlpobj.docfiles = table indexed by numbers +-- tlpobj.docfiledata[docfile][tag] = value -- tlpobj.docsize string -- tlpobj.srcfiles = table indexed by numbers -- tlpobj.srcsize string @@ -173,11 +174,25 @@ function read_tlpdb(root) table.insert(tlpobj.runfiles,rest) lastcmd = "runfiles" elseif first == "docfilescontinued" then + local dfile,tags = string.match(rest,'^(%S+)%s*(.*)%s*$') if not(tlpobj.docfiles) then tlpobj.docfiles = {} end - -- TODO doc files can have tags!!!! - table.insert(tlpobj.docfiles,rest) + table.insert(tlpobj.docfiles,dfile) + for aaa,bbb in string.gmatch(tags,'(%S+)=(%b"")') do + if not(tlpobj.docfiledata) then + tlpobj.docfiledata = {} + end + if aaa == "details" or aaa == "language" then + if not(tlpobj.docfiledata[dfile]) then + tlpobj.docfiledata[dfile] = {} + end + tlpobj.docfiledata[dfile][aaa] = bbb + else + io.stderr:write('Error reading tlpdb: unknown docfile tag in line\n>>'..line.."<<\n") + os.exit(1) + end + end lastcmd = "docfiles" elseif first == "srcfilescontinued" then if not(tlpobj.srcfiles) then -- cgit v1.2.3