summaryrefslogtreecommitdiff
path: root/scripts/context/stubs
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2017-11-07 12:49:36 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2017-11-07 12:49:36 +0100
commit75fbb107b15d01179a4b772844144e0661240e77 (patch)
treec5210f4f9ade25c89a540f755912a52966404792 /scripts/context/stubs
parent7830451577b876020de2a26bbfbf069625ab4d6f (diff)
downloadcontext-75fbb107b15d01179a4b772844144e0661240e77.tar.gz
2017-11-07 11:43:00
Diffstat (limited to 'scripts/context/stubs')
-rw-r--r--scripts/context/stubs/mswin/mtxrun.lua39
-rw-r--r--scripts/context/stubs/setup/setuptex100
-rw-r--r--scripts/context/stubs/unix/mtxrun39
-rw-r--r--scripts/context/stubs/win64/mtxrun.lua39
4 files changed, 128 insertions, 89 deletions
diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua
index 558b791fe..a92192a2a 100644
--- a/scripts/context/stubs/mswin/mtxrun.lua
+++ b/scripts/context/stubs/mswin/mtxrun.lua
@@ -598,7 +598,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-package"] = package.loaded["l-package"] or true
--- original size: 11545, stripped down to: 8606
+-- original size: 11564, stripped down to: 8625
if not modules then modules={} end modules ['l-package']={
version=1.001,
@@ -611,7 +611,7 @@ local type=type
local gsub,format,find=string.gsub,string.format,string.find
local P,S,Cs,lpegmatch=lpeg.P,lpeg.S,lpeg.Cs,lpeg.match
local package=package
-local searchers=package.searchers
+local searchers=package.searchers or package.loaders
local insert,remove=table.insert,table.remove
local filejoin=file and file.join or function(path,name) return path.."/"..name end
local isreadable=file and file.is_readable or function(name) local f=io.open(name) if f then f:close() return true end end
@@ -1735,7 +1735,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-string"] = package.loaded["l-string"] or true
--- original size: 6420, stripped down to: 3339
+-- original size: 6461, stripped down to: 3341
if not modules then modules={} end modules ['l-string']={
version=1.001,
@@ -1837,9 +1837,9 @@ function string.tformat(fmt,...)
end
string.quote=string.quoted
string.unquote=string.unquoted
-if not string.bytetable then
+if not string.bytetable then
local limit=5000
- function string.bytetable(str)
+ function string.bytetable(str)
local n=#str
if n>limit then
local t={ byte(str,1,limit) }
@@ -3853,7 +3853,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-file"] = package.loaded["l-file"] or true
--- original size: 20997, stripped down to: 9986
+-- original size: 21090, stripped down to: 10074
if not modules then modules={} end modules ['l-file']={
version=1.001,
@@ -3889,6 +3889,9 @@ end
function lfs.isfile(name)
return attributes(name,"mode")=="file"
end
+function lfs.isfound(name)
+ return attributes(name,"mode")=="file" and name or nil
+end
local colon=P(":")
local period=P(".")
local periods=P("..")
@@ -10243,7 +10246,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-lua"] = package.loaded["util-lua"] or true
--- original size: 6662, stripped down to: 4771
+-- original size: 6921, stripped down to: 4998
if not modules then modules={} end modules ['util-lua']={
version=1.001,
@@ -10313,7 +10316,7 @@ function luautilities.loadedluacode(fullname,forcestrip,name,macros)
end
if macros and macros.enabled then
local f=io.open(fullname,"rb") local c=f:read("*a") f:close()
- local n=c and macros.resolvestring(c)
+ local n=c and macros.resolvestring("--[["..fullname.."]] "..c)
if n and #n~=#c then
report_lua("preprocessed file %a: %i => %i bytes",fullname,#c,#n)
end
@@ -10343,7 +10346,7 @@ function luautilities.loadedluacode(fullname,forcestrip,name,macros)
return code,0
end
end
-function luautilities.strippedloadstring(code,forcestrip,name)
+function luautilities.strippedloadstring(code,name,forcestrip)
local code,message=load(code)
if not code then
report_lua("loading of file %a failed:\n\t%s",name,message or "no message")
@@ -10355,6 +10358,13 @@ function luautilities.strippedloadstring(code,forcestrip,name)
return code,0
end
end
+function luautilities.loadstring(code,name)
+ local code,message=load(code)
+ if not code then
+ report_lua("loading of file %a failed:\n\t%s",name,message or "no message")
+ end
+ return code,0
+end
function luautilities.compile(luafile,lucfile,cleanup,strip,fallback)
report_lua("compiling %a into %a",luafile,lucfile)
os.remove(lucfile)
@@ -20370,7 +20380,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-lib"] = package.loaded["util-lib"] or true
--- original size: 14333, stripped down to: 7859
+-- original size: 14415, stripped down to: 7927
if not modules then modules={} end modules ['util-lib']={
version=1.001,
@@ -20481,9 +20491,10 @@ local function locate(required,version,trace,report,action)
end
package.extralibpath(environment.ownpath)
local paths=package.libpaths()
+ local pattern="/[^/]+%."..os.libsuffix.."$"
for i=1,#paths do
- required_path=paths[i]
- local found=check(lfs.isfile)
+ required_path=gsub(paths[i],pattern,"")
+ local found=check(lfs.isfound)
if type(found)=="string" and (not checkpattern or find(found,checkpattern)) then
return found
end
@@ -20978,8 +20989,8 @@ end -- of closure
-- used libraries : l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 865625
--- stripped bytes : 315093
+-- original bytes : 866119
+-- stripped bytes : 315183
-- end library merge
diff --git a/scripts/context/stubs/setup/setuptex b/scripts/context/stubs/setup/setuptex
index d41e36707..78128ee8b 100644
--- a/scripts/context/stubs/setup/setuptex
+++ b/scripts/context/stubs/setup/setuptex
@@ -22,53 +22,59 @@ system=`uname -s`
cpu=`uname -m`
case "$system" in
- # linux
- Linux)
- case "$cpu" in
- i*86) platform="linux" ;;
- x86_64|ia64) platform="linux-64" ;;
- # a little bit of cheating with ppc64 (won't work on Gentoo)
- ppc|ppc64) platform="linux-ppc" ;;
- *) platform="unknown" ;;
- esac ;;
- # Mac OS X
- Darwin)
- case "$cpu" in
- i*86) platform="osx-intel" ;;
- x86_64) platform="osx-64" ;;
- ppc*|powerpc|power*|Power*) platform="osx-ppc" ;;
- *) platform="unknown" ;;
- esac ;;
- # FreeBSD
- FreeBSD|freebsd)
- case "$cpu" in
- i*86) platform="freebsd" ;;
- x86_64) platform="freebsd" ;;
- amd64) platform="freebsd-amd64" ;;
- *) platform="unknown" ;;
- esac ;;
- # kFreeBSD (Debian)
- GNU/kFreeBSD)
- case "$cpu" in
- i*86) platform="kfreebsd-i386" ;;
- x86_64|amd64) platform="kfreebsd-amd64" ;;
- *) platform="unknown" ;;
- esac ;;
- # cygwin
- CYGWIN)
- case "$cpu" in
- i*86) platform="cygwin" ;;
- x86_64|ia64) platform="cygwin-64" ;;
- *) platform="unknown" ;;
- esac ;;
- # SunOS/Solaris
- SunOS)
- case "$cpu" in
- sparc) platform="solaris-sparc" ;;
- i86pc) platform="solaris-intel" ;;
- *) platform="unknown" ;;
- esac ;;
- *) platform="unknown"
+ # linux
+ Linux)
+ case "$cpu" in
+ i*86) platform="linux" ;;
+ x86_64|ia64) platform="linux-64" ;;
+ # a little bit of cheating with ppc64 (won't work on Gentoo)
+ ppc|ppc64) platform="linux-ppc" ;;
+ *) platform="unknown" ;;
+ esac ;;
+ # Mac OS X
+ Darwin)
+ case "$cpu" in
+ i*86) platform="osx-intel" ;;
+ x86_64) platform="osx-64" ;;
+ ppc*|powerpc|power*|Power*) platform="osx-ppc" ;;
+ *) platform="unknown" ;;
+ esac ;;
+ # FreeBSD
+ FreeBSD|freebsd)
+ case "$cpu" in
+ i*86) platform="freebsd" ;;
+ x86_64) platform="freebsd" ;;
+ amd64) platform="freebsd-amd64" ;;
+ *) platform="unknown" ;;
+ esac ;;
+ # kFreeBSD (Debian)
+ GNU/kFreeBSD)
+ case "$cpu" in
+ i*86) platform="kfreebsd-i386" ;;
+ x86_64|amd64) platform="kfreebsd-amd64" ;;
+ *) platform="unknown" ;;
+ esac ;;
+ # MSYS2|MSYS_NT-10.0)
+ case "$cpu" in
+ i*86) platform="win32" ;;
+ x86_64) platform="win64" ;;
+ *) platform="unknown" ;;
+ esac ;;
+ # cygwin
+ CYGWIN)
+ case "$cpu" in
+ i*86) platform="cygwin" ;;
+ x86_64|ia64) platform="cygwin-64" ;;
+ *) platform="unknown" ;;
+ esac ;;
+ # SunOS/Solaris
+ SunOS)
+ case "$cpu" in
+ sparc) platform="solaris-sparc" ;;
+ i86pc) platform="solaris-intel" ;;
+ *) platform="unknown" ;;
+ esac ;;
+ *) platform="unknown"
esac
# temporary fix for Snow Leopard
diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun
index 558b791fe..a92192a2a 100644
--- a/scripts/context/stubs/unix/mtxrun
+++ b/scripts/context/stubs/unix/mtxrun
@@ -598,7 +598,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-package"] = package.loaded["l-package"] or true
--- original size: 11545, stripped down to: 8606
+-- original size: 11564, stripped down to: 8625
if not modules then modules={} end modules ['l-package']={
version=1.001,
@@ -611,7 +611,7 @@ local type=type
local gsub,format,find=string.gsub,string.format,string.find
local P,S,Cs,lpegmatch=lpeg.P,lpeg.S,lpeg.Cs,lpeg.match
local package=package
-local searchers=package.searchers
+local searchers=package.searchers or package.loaders
local insert,remove=table.insert,table.remove
local filejoin=file and file.join or function(path,name) return path.."/"..name end
local isreadable=file and file.is_readable or function(name) local f=io.open(name) if f then f:close() return true end end
@@ -1735,7 +1735,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-string"] = package.loaded["l-string"] or true
--- original size: 6420, stripped down to: 3339
+-- original size: 6461, stripped down to: 3341
if not modules then modules={} end modules ['l-string']={
version=1.001,
@@ -1837,9 +1837,9 @@ function string.tformat(fmt,...)
end
string.quote=string.quoted
string.unquote=string.unquoted
-if not string.bytetable then
+if not string.bytetable then
local limit=5000
- function string.bytetable(str)
+ function string.bytetable(str)
local n=#str
if n>limit then
local t={ byte(str,1,limit) }
@@ -3853,7 +3853,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-file"] = package.loaded["l-file"] or true
--- original size: 20997, stripped down to: 9986
+-- original size: 21090, stripped down to: 10074
if not modules then modules={} end modules ['l-file']={
version=1.001,
@@ -3889,6 +3889,9 @@ end
function lfs.isfile(name)
return attributes(name,"mode")=="file"
end
+function lfs.isfound(name)
+ return attributes(name,"mode")=="file" and name or nil
+end
local colon=P(":")
local period=P(".")
local periods=P("..")
@@ -10243,7 +10246,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-lua"] = package.loaded["util-lua"] or true
--- original size: 6662, stripped down to: 4771
+-- original size: 6921, stripped down to: 4998
if not modules then modules={} end modules ['util-lua']={
version=1.001,
@@ -10313,7 +10316,7 @@ function luautilities.loadedluacode(fullname,forcestrip,name,macros)
end
if macros and macros.enabled then
local f=io.open(fullname,"rb") local c=f:read("*a") f:close()
- local n=c and macros.resolvestring(c)
+ local n=c and macros.resolvestring("--[["..fullname.."]] "..c)
if n and #n~=#c then
report_lua("preprocessed file %a: %i => %i bytes",fullname,#c,#n)
end
@@ -10343,7 +10346,7 @@ function luautilities.loadedluacode(fullname,forcestrip,name,macros)
return code,0
end
end
-function luautilities.strippedloadstring(code,forcestrip,name)
+function luautilities.strippedloadstring(code,name,forcestrip)
local code,message=load(code)
if not code then
report_lua("loading of file %a failed:\n\t%s",name,message or "no message")
@@ -10355,6 +10358,13 @@ function luautilities.strippedloadstring(code,forcestrip,name)
return code,0
end
end
+function luautilities.loadstring(code,name)
+ local code,message=load(code)
+ if not code then
+ report_lua("loading of file %a failed:\n\t%s",name,message or "no message")
+ end
+ return code,0
+end
function luautilities.compile(luafile,lucfile,cleanup,strip,fallback)
report_lua("compiling %a into %a",luafile,lucfile)
os.remove(lucfile)
@@ -20370,7 +20380,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-lib"] = package.loaded["util-lib"] or true
--- original size: 14333, stripped down to: 7859
+-- original size: 14415, stripped down to: 7927
if not modules then modules={} end modules ['util-lib']={
version=1.001,
@@ -20481,9 +20491,10 @@ local function locate(required,version,trace,report,action)
end
package.extralibpath(environment.ownpath)
local paths=package.libpaths()
+ local pattern="/[^/]+%."..os.libsuffix.."$"
for i=1,#paths do
- required_path=paths[i]
- local found=check(lfs.isfile)
+ required_path=gsub(paths[i],pattern,"")
+ local found=check(lfs.isfound)
if type(found)=="string" and (not checkpattern or find(found,checkpattern)) then
return found
end
@@ -20978,8 +20989,8 @@ end -- of closure
-- used libraries : l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 865625
--- stripped bytes : 315093
+-- original bytes : 866119
+-- stripped bytes : 315183
-- end library merge
diff --git a/scripts/context/stubs/win64/mtxrun.lua b/scripts/context/stubs/win64/mtxrun.lua
index 558b791fe..a92192a2a 100644
--- a/scripts/context/stubs/win64/mtxrun.lua
+++ b/scripts/context/stubs/win64/mtxrun.lua
@@ -598,7 +598,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-package"] = package.loaded["l-package"] or true
--- original size: 11545, stripped down to: 8606
+-- original size: 11564, stripped down to: 8625
if not modules then modules={} end modules ['l-package']={
version=1.001,
@@ -611,7 +611,7 @@ local type=type
local gsub,format,find=string.gsub,string.format,string.find
local P,S,Cs,lpegmatch=lpeg.P,lpeg.S,lpeg.Cs,lpeg.match
local package=package
-local searchers=package.searchers
+local searchers=package.searchers or package.loaders
local insert,remove=table.insert,table.remove
local filejoin=file and file.join or function(path,name) return path.."/"..name end
local isreadable=file and file.is_readable or function(name) local f=io.open(name) if f then f:close() return true end end
@@ -1735,7 +1735,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-string"] = package.loaded["l-string"] or true
--- original size: 6420, stripped down to: 3339
+-- original size: 6461, stripped down to: 3341
if not modules then modules={} end modules ['l-string']={
version=1.001,
@@ -1837,9 +1837,9 @@ function string.tformat(fmt,...)
end
string.quote=string.quoted
string.unquote=string.unquoted
-if not string.bytetable then
+if not string.bytetable then
local limit=5000
- function string.bytetable(str)
+ function string.bytetable(str)
local n=#str
if n>limit then
local t={ byte(str,1,limit) }
@@ -3853,7 +3853,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-file"] = package.loaded["l-file"] or true
--- original size: 20997, stripped down to: 9986
+-- original size: 21090, stripped down to: 10074
if not modules then modules={} end modules ['l-file']={
version=1.001,
@@ -3889,6 +3889,9 @@ end
function lfs.isfile(name)
return attributes(name,"mode")=="file"
end
+function lfs.isfound(name)
+ return attributes(name,"mode")=="file" and name or nil
+end
local colon=P(":")
local period=P(".")
local periods=P("..")
@@ -10243,7 +10246,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-lua"] = package.loaded["util-lua"] or true
--- original size: 6662, stripped down to: 4771
+-- original size: 6921, stripped down to: 4998
if not modules then modules={} end modules ['util-lua']={
version=1.001,
@@ -10313,7 +10316,7 @@ function luautilities.loadedluacode(fullname,forcestrip,name,macros)
end
if macros and macros.enabled then
local f=io.open(fullname,"rb") local c=f:read("*a") f:close()
- local n=c and macros.resolvestring(c)
+ local n=c and macros.resolvestring("--[["..fullname.."]] "..c)
if n and #n~=#c then
report_lua("preprocessed file %a: %i => %i bytes",fullname,#c,#n)
end
@@ -10343,7 +10346,7 @@ function luautilities.loadedluacode(fullname,forcestrip,name,macros)
return code,0
end
end
-function luautilities.strippedloadstring(code,forcestrip,name)
+function luautilities.strippedloadstring(code,name,forcestrip)
local code,message=load(code)
if not code then
report_lua("loading of file %a failed:\n\t%s",name,message or "no message")
@@ -10355,6 +10358,13 @@ function luautilities.strippedloadstring(code,forcestrip,name)
return code,0
end
end
+function luautilities.loadstring(code,name)
+ local code,message=load(code)
+ if not code then
+ report_lua("loading of file %a failed:\n\t%s",name,message or "no message")
+ end
+ return code,0
+end
function luautilities.compile(luafile,lucfile,cleanup,strip,fallback)
report_lua("compiling %a into %a",luafile,lucfile)
os.remove(lucfile)
@@ -20370,7 +20380,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-lib"] = package.loaded["util-lib"] or true
--- original size: 14333, stripped down to: 7859
+-- original size: 14415, stripped down to: 7927
if not modules then modules={} end modules ['util-lib']={
version=1.001,
@@ -20481,9 +20491,10 @@ local function locate(required,version,trace,report,action)
end
package.extralibpath(environment.ownpath)
local paths=package.libpaths()
+ local pattern="/[^/]+%."..os.libsuffix.."$"
for i=1,#paths do
- required_path=paths[i]
- local found=check(lfs.isfile)
+ required_path=gsub(paths[i],pattern,"")
+ local found=check(lfs.isfound)
if type(found)=="string" and (not checkpattern or find(found,checkpattern)) then
return found
end
@@ -20978,8 +20989,8 @@ end -- of closure
-- used libraries : l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 865625
--- stripped bytes : 315093
+-- original bytes : 866119
+-- stripped bytes : 315183
-- end library merge