From 8c0bb98e13632d6caf24fd08261ff4bca4fdd4eb Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Wed, 12 May 2010 18:43:00 +0200 Subject: beta 2010.05.12 18:43 --- scripts/context/lua/luatools.lua | 27 +++++++++++++++++++++++++-- scripts/context/lua/mtx-mptopdf.lua | 2 +- scripts/context/lua/mtx-update.lua | 1 + scripts/context/lua/mtxrun.lua | 27 +++++++++++++++++++++++++-- scripts/context/stubs/mswin/luatools.lua | 27 +++++++++++++++++++++++++-- scripts/context/stubs/mswin/mtxrun.lua | 27 +++++++++++++++++++++++++-- scripts/context/stubs/unix/luatools | 27 +++++++++++++++++++++++++-- scripts/context/stubs/unix/mtxrun | 27 +++++++++++++++++++++++++-- 8 files changed, 152 insertions(+), 13 deletions(-) (limited to 'scripts') diff --git a/scripts/context/lua/luatools.lua b/scripts/context/lua/luatools.lua index ccedd97cd..e6fdd50d5 100644 --- a/scripts/context/lua/luatools.lua +++ b/scripts/context/lua/luatools.lua @@ -428,6 +428,15 @@ lpeg.splitat = splitat local cache = { } +function lpeg.split(separator,str) + local c = cache[separator] + if not c then + c = Ct(splitat(separator)) + cache[separator] = c + end + return match(c,str) +end + function string:split(separator) local c = cache[separator] if not c then @@ -439,6 +448,17 @@ end local cache = { } +function lpeg.checkedsplit(separator,str) + local c = cache[separator] + if not c then + separator = P(separator) + local other = C((1 - separator)^0) + c = Ct(separator^0 * other * (separator^1 * other)^0) + cache[separator] = c + end + return match(c,str) +end + function string:checkedsplit(separator) local c = cache[separator] if not c then @@ -5710,6 +5730,8 @@ local normalsplit = string.split local cache = { } +local splitter = lpeg.Ct(lpeg.splitat(lpeg.S(os.type == "windows" and ";" or ":;"))) + local function split_kpse_path(str) -- beware, this can be either a path or a {specification} local found = cache[str] if not found then @@ -5717,7 +5739,8 @@ local function split_kpse_path(str) -- beware, this can be either a path or a {s found = { } else str = gsub(str,"\\","/") - local split = (find(str,";") and checkedsplit(str,";")) or checkedsplit(str,io.pathseparator) +--~ local split = (find(str,";") and checkedsplit(str,";")) or checkedsplit(str,io.pathseparator) +local split = lpegmatch(splitter,str) found = { } for i=1,#split do local s = split[i] @@ -6180,7 +6203,7 @@ end function resolvers.expanded_path_list(str) if not str then - return ep or { } + return ep or { } -- ep ? elseif instance.savelists then -- engine+progname hash str = gsub(str,"%$","") diff --git a/scripts/context/lua/mtx-mptopdf.lua b/scripts/context/lua/mtx-mptopdf.lua index 6fa5bbcb8..c3d5b50dc 100644 --- a/scripts/context/lua/mtx-mptopdf.lua +++ b/scripts/context/lua/mtx-mptopdf.lua @@ -99,7 +99,7 @@ function scripts.mptopdf.convertall() logs.simple("%s => %s", r[1], r[2]) end else - logs.simple("no input files match %s", table.concat(files,' ')) + logs.simple("no files are converted") end else logs.simple("no files match %s", table.concat(environment.files,' ')) diff --git a/scripts/context/lua/mtx-update.lua b/scripts/context/lua/mtx-update.lua index 8affaf01b..b63be6475 100644 --- a/scripts/context/lua/mtx-update.lua +++ b/scripts/context/lua/mtx-update.lua @@ -196,6 +196,7 @@ function scripts.update.synchronize() if force then dir.mkdirs(format("%s/%s", texroot, "texmf-cache")) dir.mkdirs(format("%s/%s", texroot, "texmf-local")) + dir.mkdirs(format("%s/%s", texroot, "texmf-project")) end if ok or not force then diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index cefa3192b..727099027 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -437,6 +437,15 @@ lpeg.splitat = splitat local cache = { } +function lpeg.split(separator,str) + local c = cache[separator] + if not c then + c = Ct(splitat(separator)) + cache[separator] = c + end + return match(c,str) +end + function string:split(separator) local c = cache[separator] if not c then @@ -448,6 +457,17 @@ end local cache = { } +function lpeg.checkedsplit(separator,str) + local c = cache[separator] + if not c then + separator = P(separator) + local other = C((1 - separator)^0) + c = Ct(separator^0 * other * (separator^1 * other)^0) + cache[separator] = c + end + return match(c,str) +end + function string:checkedsplit(separator) local c = cache[separator] if not c then @@ -8911,6 +8931,8 @@ local normalsplit = string.split local cache = { } +local splitter = lpeg.Ct(lpeg.splitat(lpeg.S(os.type == "windows" and ";" or ":;"))) + local function split_kpse_path(str) -- beware, this can be either a path or a {specification} local found = cache[str] if not found then @@ -8918,7 +8940,8 @@ local function split_kpse_path(str) -- beware, this can be either a path or a {s found = { } else str = gsub(str,"\\","/") - local split = (find(str,";") and checkedsplit(str,";")) or checkedsplit(str,io.pathseparator) +--~ local split = (find(str,";") and checkedsplit(str,";")) or checkedsplit(str,io.pathseparator) +local split = lpegmatch(splitter,str) found = { } for i=1,#split do local s = split[i] @@ -9381,7 +9404,7 @@ end function resolvers.expanded_path_list(str) if not str then - return ep or { } + return ep or { } -- ep ? elseif instance.savelists then -- engine+progname hash str = gsub(str,"%$","") diff --git a/scripts/context/stubs/mswin/luatools.lua b/scripts/context/stubs/mswin/luatools.lua index ccedd97cd..e6fdd50d5 100644 --- a/scripts/context/stubs/mswin/luatools.lua +++ b/scripts/context/stubs/mswin/luatools.lua @@ -428,6 +428,15 @@ lpeg.splitat = splitat local cache = { } +function lpeg.split(separator,str) + local c = cache[separator] + if not c then + c = Ct(splitat(separator)) + cache[separator] = c + end + return match(c,str) +end + function string:split(separator) local c = cache[separator] if not c then @@ -439,6 +448,17 @@ end local cache = { } +function lpeg.checkedsplit(separator,str) + local c = cache[separator] + if not c then + separator = P(separator) + local other = C((1 - separator)^0) + c = Ct(separator^0 * other * (separator^1 * other)^0) + cache[separator] = c + end + return match(c,str) +end + function string:checkedsplit(separator) local c = cache[separator] if not c then @@ -5710,6 +5730,8 @@ local normalsplit = string.split local cache = { } +local splitter = lpeg.Ct(lpeg.splitat(lpeg.S(os.type == "windows" and ";" or ":;"))) + local function split_kpse_path(str) -- beware, this can be either a path or a {specification} local found = cache[str] if not found then @@ -5717,7 +5739,8 @@ local function split_kpse_path(str) -- beware, this can be either a path or a {s found = { } else str = gsub(str,"\\","/") - local split = (find(str,";") and checkedsplit(str,";")) or checkedsplit(str,io.pathseparator) +--~ local split = (find(str,";") and checkedsplit(str,";")) or checkedsplit(str,io.pathseparator) +local split = lpegmatch(splitter,str) found = { } for i=1,#split do local s = split[i] @@ -6180,7 +6203,7 @@ end function resolvers.expanded_path_list(str) if not str then - return ep or { } + return ep or { } -- ep ? elseif instance.savelists then -- engine+progname hash str = gsub(str,"%$","") diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index cefa3192b..727099027 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -437,6 +437,15 @@ lpeg.splitat = splitat local cache = { } +function lpeg.split(separator,str) + local c = cache[separator] + if not c then + c = Ct(splitat(separator)) + cache[separator] = c + end + return match(c,str) +end + function string:split(separator) local c = cache[separator] if not c then @@ -448,6 +457,17 @@ end local cache = { } +function lpeg.checkedsplit(separator,str) + local c = cache[separator] + if not c then + separator = P(separator) + local other = C((1 - separator)^0) + c = Ct(separator^0 * other * (separator^1 * other)^0) + cache[separator] = c + end + return match(c,str) +end + function string:checkedsplit(separator) local c = cache[separator] if not c then @@ -8911,6 +8931,8 @@ local normalsplit = string.split local cache = { } +local splitter = lpeg.Ct(lpeg.splitat(lpeg.S(os.type == "windows" and ";" or ":;"))) + local function split_kpse_path(str) -- beware, this can be either a path or a {specification} local found = cache[str] if not found then @@ -8918,7 +8940,8 @@ local function split_kpse_path(str) -- beware, this can be either a path or a {s found = { } else str = gsub(str,"\\","/") - local split = (find(str,";") and checkedsplit(str,";")) or checkedsplit(str,io.pathseparator) +--~ local split = (find(str,";") and checkedsplit(str,";")) or checkedsplit(str,io.pathseparator) +local split = lpegmatch(splitter,str) found = { } for i=1,#split do local s = split[i] @@ -9381,7 +9404,7 @@ end function resolvers.expanded_path_list(str) if not str then - return ep or { } + return ep or { } -- ep ? elseif instance.savelists then -- engine+progname hash str = gsub(str,"%$","") diff --git a/scripts/context/stubs/unix/luatools b/scripts/context/stubs/unix/luatools index ccedd97cd..e6fdd50d5 100755 --- a/scripts/context/stubs/unix/luatools +++ b/scripts/context/stubs/unix/luatools @@ -428,6 +428,15 @@ lpeg.splitat = splitat local cache = { } +function lpeg.split(separator,str) + local c = cache[separator] + if not c then + c = Ct(splitat(separator)) + cache[separator] = c + end + return match(c,str) +end + function string:split(separator) local c = cache[separator] if not c then @@ -439,6 +448,17 @@ end local cache = { } +function lpeg.checkedsplit(separator,str) + local c = cache[separator] + if not c then + separator = P(separator) + local other = C((1 - separator)^0) + c = Ct(separator^0 * other * (separator^1 * other)^0) + cache[separator] = c + end + return match(c,str) +end + function string:checkedsplit(separator) local c = cache[separator] if not c then @@ -5710,6 +5730,8 @@ local normalsplit = string.split local cache = { } +local splitter = lpeg.Ct(lpeg.splitat(lpeg.S(os.type == "windows" and ";" or ":;"))) + local function split_kpse_path(str) -- beware, this can be either a path or a {specification} local found = cache[str] if not found then @@ -5717,7 +5739,8 @@ local function split_kpse_path(str) -- beware, this can be either a path or a {s found = { } else str = gsub(str,"\\","/") - local split = (find(str,";") and checkedsplit(str,";")) or checkedsplit(str,io.pathseparator) +--~ local split = (find(str,";") and checkedsplit(str,";")) or checkedsplit(str,io.pathseparator) +local split = lpegmatch(splitter,str) found = { } for i=1,#split do local s = split[i] @@ -6180,7 +6203,7 @@ end function resolvers.expanded_path_list(str) if not str then - return ep or { } + return ep or { } -- ep ? elseif instance.savelists then -- engine+progname hash str = gsub(str,"%$","") diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index cefa3192b..727099027 100755 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -437,6 +437,15 @@ lpeg.splitat = splitat local cache = { } +function lpeg.split(separator,str) + local c = cache[separator] + if not c then + c = Ct(splitat(separator)) + cache[separator] = c + end + return match(c,str) +end + function string:split(separator) local c = cache[separator] if not c then @@ -448,6 +457,17 @@ end local cache = { } +function lpeg.checkedsplit(separator,str) + local c = cache[separator] + if not c then + separator = P(separator) + local other = C((1 - separator)^0) + c = Ct(separator^0 * other * (separator^1 * other)^0) + cache[separator] = c + end + return match(c,str) +end + function string:checkedsplit(separator) local c = cache[separator] if not c then @@ -8911,6 +8931,8 @@ local normalsplit = string.split local cache = { } +local splitter = lpeg.Ct(lpeg.splitat(lpeg.S(os.type == "windows" and ";" or ":;"))) + local function split_kpse_path(str) -- beware, this can be either a path or a {specification} local found = cache[str] if not found then @@ -8918,7 +8940,8 @@ local function split_kpse_path(str) -- beware, this can be either a path or a {s found = { } else str = gsub(str,"\\","/") - local split = (find(str,";") and checkedsplit(str,";")) or checkedsplit(str,io.pathseparator) +--~ local split = (find(str,";") and checkedsplit(str,";")) or checkedsplit(str,io.pathseparator) +local split = lpegmatch(splitter,str) found = { } for i=1,#split do local s = split[i] @@ -9381,7 +9404,7 @@ end function resolvers.expanded_path_list(str) if not str then - return ep or { } + return ep or { } -- ep ? elseif instance.savelists then -- engine+progname hash str = gsub(str,"%$","") -- cgit v1.2.3