From 57ea7dad48fbf2541c04e434c31bde655ada3ac4 Mon Sep 17 00:00:00 2001 From: Taco Hoekwater Date: Mon, 24 May 2010 14:05:02 +0000 Subject: here is context 2010.05.24 13:05 git-svn-id: svn://tug.org/texlive/trunk@18445 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/context/base/data-pre.lua | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'Master/texmf-dist/tex/context/base/data-pre.lua') diff --git a/Master/texmf-dist/tex/context/base/data-pre.lua b/Master/texmf-dist/tex/context/base/data-pre.lua index deee9ebf46f..9348f6cd39c 100644 --- a/Master/texmf-dist/tex/context/base/data-pre.lua +++ b/Master/texmf-dist/tex/context/base/data-pre.lua @@ -1,6 +1,6 @@ if not modules then modules = { } end modules ['data-res'] = { version = 1.001, - comment = "companion to luat-lib.tex", + comment = "companion to luat-lib.mkiv", author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", copyright = "PRAGMA ADE / ConTeXt Development Team", license = "see context related readme files" @@ -35,6 +35,14 @@ prefixes.relative = function(str,n) return resolvers.clean_path(str) end +prefixes.auto = function(str) + local fullname = prefixes.relative(str) + if not lfs.isfile(fullname) then + fullname = prefixes.locate(str) + end + return fullname +end + prefixes.locate = function(str) local fullname = resolvers.find_given_file(str) or "" return resolvers.clean_path((fullname ~= "" and fullname) or str) @@ -58,6 +66,16 @@ prefixes.full = prefixes.locate prefixes.file = prefixes.filename prefixes.path = prefixes.pathname +function resolvers.allprefixes(separator) + local all = table.sortedkeys(prefixes) + if separator then + for i=1,#all do + all[i] = all[i] .. ":" + end + end + return all +end + local function _resolve_(method,target) if prefixes[method] then return prefixes[method](target) @@ -68,7 +86,8 @@ end local function resolve(str) if type(str) == "table" then - for k, v in pairs(str) do -- ipairs + for k=1,#str do + local v = str[k] str[k] = resolve(v) or v end elseif str and str ~= "" then @@ -81,7 +100,7 @@ resolvers.resolve = resolve if os.uname then - for k, v in pairs(os.uname()) do + for k, v in next, os.uname() do if not prefixes[k] then prefixes[k] = function() return v end end -- cgit v1.2.3