diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/context/lua/mtx-install-modules.lua | 152 | ||||
-rw-r--r-- | scripts/context/lua/mtx-install.lua | 19 |
2 files changed, 69 insertions, 102 deletions
diff --git a/scripts/context/lua/mtx-install-modules.lua b/scripts/context/lua/mtx-install-modules.lua index 590e321fe..2073cf6e1 100644 --- a/scripts/context/lua/mtx-install-modules.lua +++ b/scripts/context/lua/mtx-install-modules.lua @@ -105,6 +105,53 @@ local urls = { local tmpzipfile = "temp.zip" local checkdir = "texmf-context" local targetdir = "texmf-modules" +local basefile = "mtx-install-imp-modules.lua" +local lists = false + +-- local lists = { +-- ["tikz"] = { +-- url = "ctan", +-- zips = { }, -- table of zip files +-- wipes = { }, -- (nested) table of delete patterns +-- }, +-- ["filter"] = { +-- url = "modules", +-- zips = { "t-filter.zip" } +-- }, +-- } + +local function loadlists() + if not lists then + lists = { } + local mainfile = resolvers.findfile(basefile) + if mainfile and mainfile ~= "" then + local path = file.pathpart(mainfile) + local files = dir.glob((path == "" and "." or path) .. "/mtx-install-imp*.lua") + for i=1,#files do + local name = files[i] + local data = table.load(name) + if data then + local entries = data.lists + if entries then + report("loading entries from file %a",name) + for entry, data in table.sortedhash(entries) do + if lists[entry] then + report("entry %a already set from %a",entry,name) + else + lists[entry] = data + end + end + else + report("no entries in file %a",name) + end + end + end + else + report("base file %a is not found",basefile) + end + end + report() +end local function install(list) if type(list) ~= "table"then @@ -155,109 +202,8 @@ local function install(list) end end -local function wipers(s) - return { - "tex/context/third/" ..s.. "/**", - "doc/context/third/" ..s.. "/**", - "source/context/third/" ..s.. "/**", - - "tex/context/" ..s.. "/**", - "doc/context/" ..s.. "/**", - "source/context/" ..s.. "/**", - - "scripts/" ..s.. "/**", - } -end - -local defaults = { - "tex/latex/**", - "tex/plain/**", - - "doc/latex/**", - "doc/plain/**", - "doc/generic/**", - - "source/latex/**", - "source/plain/**", - "source/generic/**", -} - -local lists = { - ["tikz"] = { - url = "ctan", - zips = { - "graphics/pgf/base/pgf.tds.zip", - "graphics/pgf/contrib/pgfplots.tds.zip", - "graphics/pgf/contrib/circuitikz.tds.zip", - }, - wipes = { - wipers("pgf"), - wipers("pgfplots"), - wipers("circuitikz"), - defaults, - } - }, - -- from the context garden - ["pocketdiary"] = { url = "modules", zips = { "Collection-of-calendars-based-on-PocketDiary-module.zip" } }, - ["collating"] = { url = "modules", zips = { "Environment-for-collating-marks.zip" } }, - ["account"] = { url = "modules", zips = { "t-account.zip" } }, - ["algorithmic"] = { url = "modules", zips = { "t-algorithmic.zip" } }, - ["animation"] = { url = "modules", zips = { "t-animation.zip" } }, - ["annotation"] = { url = "modules", zips = { "t-annotation.zip" } }, - ["aquamints"] = { url = "modules", zips = { "aquamints.zip" } }, - ["bibmod-doc"] = { url = "modules", zips = { "bibmod-doc.zip" } }, - -- ["bnf-0.3"] = { url = "modules", zips = { "t-bnf-0.3.zip" } }, - ["bnf"] = { url = "modules", zips = { "t-bnf.zip" } }, - ["chromato"] = { url = "modules", zips = { "t-chromato.zip" } }, - ["cmscbf"] = { url = "modules", zips = { "t-cmscbf.zip" } }, - ["cmttbf"] = { url = "modules", zips = { "t-cmttbf.zip" } }, - ["crossref"] = { url = "modules", zips = { "t-crossref.zip" } }, - ["cyrillicnumbers"] = { url = "modules", zips = { "t-cyrillicnumbers.zip" } }, - ["degrade"] = { url = "modules", zips = { "t-degrade.zip" } }, - ["enigma"] = { url = "modules", zips = { "enigma.zip" } }, - ["fancybreak"] = { url = "modules", zips = { "t-fancybreak.zip" } }, - ["filter"] = { url = "modules", zips = { "t-filter.zip" } }, - ["french"] = { url = "modules", zips = { "t-french.zip" } }, - ["fullpage"] = { url = "modules", zips = { "t-fullpage.zip" } }, - ["gantt"] = { url = "modules", zips = { "t-gantt.zip" } }, - ["gfsdidot"] = { url = "modules", zips = { "gfsdidot.zip" } }, - ["gm"] = { url = "modules", zips = { "t-gm.zip" } }, - ["gnuplot"] = { url = "modules", zips = { "t-gnuplot.zip" } }, - ["greek"] = { url = "modules", zips = { "t-greek.zip" } }, - ["grph-downsample"] = { url = "modules", zips = { "grph-downsample.lua.zip" } }, - ["gs"] = { url = "modules", zips = { "t-gs.zip" } }, - ["high"] = { url = "modules", zips = { "high.zip" } }, - ["inifile"] = { url = "modules", zips = { "t-inifile.zip" } }, - ["karnaugh"] = { url = "modules", zips = { "karnaugh.zip" } }, - ["layout"] = { url = "modules", zips = { "t-layout.zip" } }, - ["letter"] = { url = "modules", zips = { "t-letter.zip" } }, - ["letterspace"] = { url = "modules", zips = { "t-letterspace.mkiv.zip" } }, - ["lettrine"] = { url = "modules", zips = { "t-lettrine.zip" } }, - ["lua-widow-control"] = { url = "modules", zips = { "lua-widow-control.zip" } }, - ["mathsets"] = { url = "modules", zips = { "t-mathsets.zip" } }, - ["metaducks"] = { url = "modules", zips = { "metaducks.zip" } }, - ["pret-c.lua"] = { url = "modules", zips = { "pret-c.lua.zip" } }, - ["rst"] = { url = "modules", zips = { "t-rst.zip" } }, - ["rsteps"] = { url = "modules", zips = { "t-rsteps.zip" } }, - ["simplebib"] = { url = "modules", zips = { "t-simplebib.zip" } }, - ["simplefonts"] = { url = "modules", zips = { "t-simplefonts.zip" } }, - ["simpleslides"] = { url = "modules", zips = { "t-simpleslides.zip" } }, - ["stormfontsupport"] = { url = "modules", zips = { "stormfontsupport.zip" } }, - ["sudoku"] = { url = "modules", zips = { "sudoku.zip" } }, - ["taspresent"] = { url = "modules", zips = { "t-taspresent.zip" } }, - ["texshow"] = { url = "modules", zips = { "u-texshow.zip" } }, - ["title"] = { url = "modules", zips = { "t-title.zip" } }, - ["transliterator"] = { url = "modules", zips = { "t-transliterator.zip" } }, - ["typearea"] = { url = "modules", zips = { "t-typearea.zip" } }, - ["typescripts"] = { url = "modules", zips = { "t-typescripts.zip" } }, - ["urwgaramond"] = { url = "modules", zips = { "f-urwgaramond.zip" } }, - ["urwgothic"] = { url = "modules", zips = { "f-urwgothic.zip" } }, - ["vim"] = { url = "modules", zips = { "t-vim.zip" } }, - ["visualcounter"] = { url = "modules", zips = { "t-visualcounter.zip" } }, -} - - function scripts.modules.list() + loadlists() for k, v in table.sortedhash(lists) do report("%-20s: %-36s : % t",k,urls[v.url],v.zips) end @@ -273,6 +219,7 @@ function scripts.modules.install() elseif not lfs.chdir(targetdir) then report("unable to go into %a",targetdir) elseif environment.argument("module") or environment.argument("modules") then + loadlists() local files = environment.files if #files == 0 then report("no archive names provided") @@ -284,6 +231,7 @@ function scripts.modules.install() done = files end else + loadlists() local files = environment.argument("all") and table.sortedkeys(lists) or environment.files if #files == 0 then report("no module names provided") diff --git a/scripts/context/lua/mtx-install.lua b/scripts/context/lua/mtx-install.lua index 4b5901282..64200ef2e 100644 --- a/scripts/context/lua/mtx-install.lua +++ b/scripts/context/lua/mtx-install.lua @@ -636,6 +636,18 @@ function install.update() report("update, done") end +function install.modules() + report("--modules in not yet implemented") +end + +function install.fonts() + report("--fonts in not yet implemented") +end + +function install.goodies() + report("--goodies in not yet implemented") +end + if environment.argument("secure") then usecurl = checkcurl() if not usecurl then @@ -650,6 +662,12 @@ elseif environment.argument("install") then install.update() elseif environment.argument("update") then install.update() +elseif environment.argument("modules") then + install.modules() +elseif environment.argument("fonts") then + install.fonts() +elseif environment.argument("goodies") then + install.goodies() elseif environment.argument("exporthelp") then application.export(environment.argument("exporthelp"),environment.files[1]) else @@ -657,3 +675,4 @@ else report("") disclaimer() end + |