From 81f5a2e306755c030618f3a51229bce98df31f20 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Mon, 18 Feb 2013 15:46:00 +0100 Subject: beta 2013.02.18 15:46 --- scripts/context/lua/mtx-update.lua | 25 ++++++++++++++++++++++--- scripts/context/lua/mtxrun.lua | 23 ++++++++++++++++++----- scripts/context/stubs/mswin/mtxrun.lua | 23 ++++++++++++++++++----- scripts/context/stubs/unix/mtxrun | 23 ++++++++++++++++++----- 4 files changed, 76 insertions(+), 18 deletions(-) (limited to 'scripts') diff --git a/scripts/context/lua/mtx-update.lua b/scripts/context/lua/mtx-update.lua index 59acf8648..8eee996b5 100644 --- a/scripts/context/lua/mtx-update.lua +++ b/scripts/context/lua/mtx-update.lua @@ -28,6 +28,8 @@ local helpinfo = [[ --make also make formats and generate file databases --keep don't delete unused or obsolete files --state update tree using saved state +--cygwin adapt drive specs to cygwin +--mingw assume mingw binaries being used ]] local application = logs.application { @@ -205,6 +207,17 @@ function scripts.update.fullpath(path) end end +local rsync_variant = "cygwin" -- will be come mingw + +local function drive(d) + if rsync_variant == "cygwin" then + d = gsub(d,[[([a-zA-Z]):/]], "/cygdrive/%1/") + else + d = gsub(d,[[([a-zA-Z]):/]], "/%1/") + end + return d +end + function scripts.update.synchronize() report("update, start") @@ -346,7 +359,7 @@ function scripts.update.synchronize() destination = gsub(destination,"\\","/") archive = gsub(archive,"",version) if osplatform == "windows" or osplatform == "mswin" then - destination = gsub(destination,"([a-zA-Z]):/", "/cygdrive/%1/") -- ^ + destination = drive(destination) end individual[#individual+1] = { archive, destination } end @@ -421,8 +434,8 @@ function scripts.update.synchronize() if platform then local command if platform == 'mswin' then - bin = gsub(bin,"([a-zA-Z]):/", "/cygdrive/%1/") - texroot = gsub(texroot,"([a-zA-Z]):/", "/cygdrive/%1/") + bin = drive(bin) + texroot = drive(texroot) command = format([[%s -t "%s/texmf-context/scripts/context/lua/%s.lua" "%s/texmf-mswin/bin/"]], bin, texroot, script, texroot) else command = format([[%s -tgo --chmod=a+x '%s/texmf-context/scripts/context/lua/%s.lua' '%s/texmf-%s/bin/%s']], bin, texroot, script, texroot, platform, script) @@ -620,6 +633,12 @@ if environment.argument("state") then environment.setargument("make",true) end +if environment.argument("mingw") then + rsync_variant = "mingw" +elseif environment.argument("cygwin") then + rsync_variant = "cygwin" +end + if environment.argument("update") then scripts.update.synchronize() if environment.argument("make") then diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index 3245a538c..7e383989c 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -56,7 +56,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-lua"] = package.loaded["l-lua"] or true --- original size: 2956, stripped down to: 1509 +-- original size: 3086, stripped down to: 1651 if not modules then modules={} end modules ['l-lua']={ version=1.001, @@ -128,6 +128,13 @@ function inspect(...) end end end +local dummy=function() end +function optionalrequire(...) + local ok,result=xpcall(require,dummy,...) + if ok then + return result + end +end end -- of closure @@ -2539,7 +2546,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-file"] = package.loaded["l-file"] or true --- original size: 16516, stripped down to: 8942 +-- original size: 16570, stripped down to: 8991 if not modules then modules={} end modules ['l-file']={ version=1.001, @@ -2550,6 +2557,9 @@ if not modules then modules={} end modules ['l-file']={ } file=file or {} local file=file +if not lfs then + lfs=optionalrequire("lfs") +end if not lfs then lfs={ getcurrentdir=function() @@ -2889,7 +2899,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-md5"] = package.loaded["l-md5"] or true --- original size: 3684, stripped down to: 2019 +-- original size: 3738, stripped down to: 2068 if not modules then modules={} end modules ['l-md5']={ version=1.001, @@ -2897,6 +2907,9 @@ if not modules then modules={} end modules ['l-md5']={ copyright="PRAGMA ADE / ConTeXt Development Team", license="see context related readme files" } +if not md5 then + md5=optionalrequire("md5") +end if not md5 then md5={ sum=function(str) print("error: md5 is not loaded (sum ignored)") return str end, @@ -14979,8 +14992,8 @@ end -- of closure -- used libraries : l-lua.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-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-tab.lua util-sto.lua util-str.lua util-mrg.lua util-lua.lua util-prs.lua util-fmt.lua util-deb.lua trac-inf.lua trac-set.lua trac-log.lua trac-pro.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-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 luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 598829 --- stripped bytes : 203330 +-- original bytes : 599067 +-- stripped bytes : 203328 -- end library merge diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index 3245a538c..7e383989c 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -56,7 +56,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-lua"] = package.loaded["l-lua"] or true --- original size: 2956, stripped down to: 1509 +-- original size: 3086, stripped down to: 1651 if not modules then modules={} end modules ['l-lua']={ version=1.001, @@ -128,6 +128,13 @@ function inspect(...) end end end +local dummy=function() end +function optionalrequire(...) + local ok,result=xpcall(require,dummy,...) + if ok then + return result + end +end end -- of closure @@ -2539,7 +2546,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-file"] = package.loaded["l-file"] or true --- original size: 16516, stripped down to: 8942 +-- original size: 16570, stripped down to: 8991 if not modules then modules={} end modules ['l-file']={ version=1.001, @@ -2550,6 +2557,9 @@ if not modules then modules={} end modules ['l-file']={ } file=file or {} local file=file +if not lfs then + lfs=optionalrequire("lfs") +end if not lfs then lfs={ getcurrentdir=function() @@ -2889,7 +2899,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-md5"] = package.loaded["l-md5"] or true --- original size: 3684, stripped down to: 2019 +-- original size: 3738, stripped down to: 2068 if not modules then modules={} end modules ['l-md5']={ version=1.001, @@ -2897,6 +2907,9 @@ if not modules then modules={} end modules ['l-md5']={ copyright="PRAGMA ADE / ConTeXt Development Team", license="see context related readme files" } +if not md5 then + md5=optionalrequire("md5") +end if not md5 then md5={ sum=function(str) print("error: md5 is not loaded (sum ignored)") return str end, @@ -14979,8 +14992,8 @@ end -- of closure -- used libraries : l-lua.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-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-tab.lua util-sto.lua util-str.lua util-mrg.lua util-lua.lua util-prs.lua util-fmt.lua util-deb.lua trac-inf.lua trac-set.lua trac-log.lua trac-pro.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-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 luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 598829 --- stripped bytes : 203330 +-- original bytes : 599067 +-- stripped bytes : 203328 -- end library merge diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index 3245a538c..7e383989c 100755 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -56,7 +56,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-lua"] = package.loaded["l-lua"] or true --- original size: 2956, stripped down to: 1509 +-- original size: 3086, stripped down to: 1651 if not modules then modules={} end modules ['l-lua']={ version=1.001, @@ -128,6 +128,13 @@ function inspect(...) end end end +local dummy=function() end +function optionalrequire(...) + local ok,result=xpcall(require,dummy,...) + if ok then + return result + end +end end -- of closure @@ -2539,7 +2546,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-file"] = package.loaded["l-file"] or true --- original size: 16516, stripped down to: 8942 +-- original size: 16570, stripped down to: 8991 if not modules then modules={} end modules ['l-file']={ version=1.001, @@ -2550,6 +2557,9 @@ if not modules then modules={} end modules ['l-file']={ } file=file or {} local file=file +if not lfs then + lfs=optionalrequire("lfs") +end if not lfs then lfs={ getcurrentdir=function() @@ -2889,7 +2899,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-md5"] = package.loaded["l-md5"] or true --- original size: 3684, stripped down to: 2019 +-- original size: 3738, stripped down to: 2068 if not modules then modules={} end modules ['l-md5']={ version=1.001, @@ -2897,6 +2907,9 @@ if not modules then modules={} end modules ['l-md5']={ copyright="PRAGMA ADE / ConTeXt Development Team", license="see context related readme files" } +if not md5 then + md5=optionalrequire("md5") +end if not md5 then md5={ sum=function(str) print("error: md5 is not loaded (sum ignored)") return str end, @@ -14979,8 +14992,8 @@ end -- of closure -- used libraries : l-lua.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-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-tab.lua util-sto.lua util-str.lua util-mrg.lua util-lua.lua util-prs.lua util-fmt.lua util-deb.lua trac-inf.lua trac-set.lua trac-log.lua trac-pro.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-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 luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 598829 --- stripped bytes : 203330 +-- original bytes : 599067 +-- stripped bytes : 203328 -- end library merge -- cgit v1.2.3