diff options
Diffstat (limited to 'Master/texmf-dist/scripts/context/lua/mtx-update.lua')
-rw-r--r-- | Master/texmf-dist/scripts/context/lua/mtx-update.lua | 87 |
1 files changed, 63 insertions, 24 deletions
diff --git a/Master/texmf-dist/scripts/context/lua/mtx-update.lua b/Master/texmf-dist/scripts/context/lua/mtx-update.lua index 037de8650ff..64203d3e3e2 100644 --- a/Master/texmf-dist/scripts/context/lua/mtx-update.lua +++ b/Master/texmf-dist/scripts/context/lua/mtx-update.lua @@ -12,27 +12,43 @@ if not modules then modules = { } end modules ['mtx-update'] = { -- platforms that matter. local helpinfo = [[ ---platform=string platform (windows, linux, linux-64, osx-intel, osx-ppc, linux-ppc) ---server=string repository url (rsync://contextgarden.net) ---module=string repository url (minimals) ---repository=string specify version (current, experimental) ---context=string specify version (current, latest, beta, yyyy.mm.dd) ---rsync=string rsync binary (rsync) ---texroot=string installation directory (not guessed for the moment) ---engine=string tex engine (luatex, pdftex, xetex) ---modules=string extra modules (can be list or 'all') ---fonts=string additional fonts (can be list or 'all') ---goodies=string extra binaries (like scite and texworks) ---force instead of a dryrun, do the real thing ---update update minimal tree ---make also make formats and generate file databases ---keep don't delete unused or obsolete files ---state update tree using saved state +<?xml version="1.0"?> +<application> + <metadata> + <entry name="name">mtx-update</entry> + <entry name="detail">ConTeXt Minimals Updater</entry> + <entry name="version">0.31</entry> + </metadata> + <flags> + <category name="basic"> + <subcategory> + <flag name="platform" value="string"><short>platform (windows, linux, linux-64, osx-intel, osx-ppc, linux-ppc)</short></flag> + <flag name="server" value="string"><short>repository url (rsync://contextgarden.net)</short></flag> + <flag name="module" value="string"><short>repository url (minimals)</short></flag> + <flag name="repository" value="string"><short>specify version (current, experimental)</short></flag> + <flag name="context" value="string"><short>specify version (current, latest, beta, yyyy.mm.dd)</short></flag> + <flag name="rsync" value="string"><short>rsync binary (rsync)</short></flag> + <flag name="texroot" value="string"><short>installation directory (not guessed for the moment)</short></flag> + <flag name="engine" value="string"><short>tex engine (luatex, pdftex, xetex)</short></flag> + <flag name="modules" value="string"><short>extra modules (can be list or 'all')</short></flag> + <flag name="fonts" value="string"><short>additional fonts (can be list or 'all')</short></flag> + <flag name="goodies" value="string"><short>extra binaries (like scite and texworks)</short></flag> + <flag name="force"><short>instead of a dryrun, do the real thing</short></flag> + <flag name="update"><short>update minimal tree</short></flag> + <flag name="make"><short>also make formats and generate file databases</short></flag> + <flag name="keep"><short>don't delete unused or obsolete files</short></flag> + <flag name="state"><short>update tree using saved state</short></flag> + <flag name="cygwin"><short>adapt drive specs to cygwin</short></flag> + <flag name="mingw"><short>assume mingw binaries being used</short></flag> + </subcategory> + </category> + </flags> +</application> ]] local application = logs.application { name = "mtx-update", - banner = "ConTeXt Minimals Updater 0.30", + banner = "ConTeXt Minimals Updater 0.31", helpinfo = helpinfo, } @@ -108,6 +124,7 @@ scripts.update.engines = { ["luatex"] = { { "fonts/new/", "texmf" }, { "bin/luatex/<platform>/", "texmf-<platform>" }, + { "bin/luajittex/<platform>/","texmf-<platform>" }, }, ["xetex"] = { { "base/xetex/", "texmf" }, @@ -125,6 +142,7 @@ scripts.update.engines = { { "fonts/old/", "texmf" }, { "base/xetex/", "texmf" }, { "bin/luatex/<platform>/", "texmf-<platform>" }, + { "bin/luajittex/<platform>/","texmf-<platform>" }, { "bin/xetex/<platform>/", "texmf-<platform>" }, { "bin/pdftex/<platform>/", "texmf-<platform>" }, }, @@ -132,10 +150,10 @@ scripts.update.engines = { scripts.update.goodies = { ["scite"] = { - { "bin/<platform>/scite/", "texmf-<platform>" }, + { "bin/<platform>/scite/", "texmf-<platform>" }, }, ["texworks"] = { - { "bin/<platform>/texworks/", "texmf-<platform>" }, + { "bin/<platform>/texworks/", "texmf-<platform>" }, }, } @@ -203,6 +221,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") @@ -344,7 +373,7 @@ function scripts.update.synchronize() destination = gsub(destination,"\\","/") archive = gsub(archive,"<version>",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 @@ -419,11 +448,11 @@ 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/") - command = format("%s -t %s/texmf-context/scripts/context/lua/%s.lua %s/texmf-mswin/bin/", bin, texroot, script, texroot) + 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) + 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) end report("updating %s for %s: %s", script, platform, command) scripts.update.run(command) @@ -496,6 +525,8 @@ function scripts.update.make() for engine in next, engines do if engine == "luatex" then scripts.update.run(format('mtxrun --tree="%s" --script context --autogenerate --make',texroot)) + elseif engine == "luajittex" then + scripts.update.run(format('mtxrun --tree="%s" --script context --autogenerate --make --engine=luajittex',texroot)) else scripts.update.run(format('mtxrun --tree="%s" --script texexec --make --all --%s %s',texroot,engine,formatlist)) end @@ -616,6 +647,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 @@ -623,6 +660,8 @@ if environment.argument("update") then end elseif environment.argument("make") then scripts.update.make() +elseif environment.argument("exporthelp") then + application.export(environment.argument("exporthelp"),environment.files[1]) else application.help() end |