summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/l3build/l3build-ctan.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-08-04 20:54:38 +0000
committerKarl Berry <karl@freefriends.org>2018-08-04 20:54:38 +0000
commite701677aa361258a69f40dad5187444352c6e14b (patch)
treeb4ff67b9a9fe0330e3f30b2d4a83acee43730681 /Master/texmf-dist/scripts/l3build/l3build-ctan.lua
parentb37c9b96f81e82408f83040ed006fb21a236538e (diff)
l3build (4aug18)
git-svn-id: svn://tug.org/texlive/trunk@48348 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/l3build/l3build-ctan.lua')
-rw-r--r--Master/texmf-dist/scripts/l3build/l3build-ctan.lua119
1 files changed, 7 insertions, 112 deletions
diff --git a/Master/texmf-dist/scripts/l3build/l3build-ctan.lua b/Master/texmf-dist/scripts/l3build/l3build-ctan.lua
index 875f50dc4fa..9d29f63f1c7 100644
--- a/Master/texmf-dist/scripts/l3build/l3build-ctan.lua
+++ b/Master/texmf-dist/scripts/l3build/l3build-ctan.lua
@@ -22,9 +22,8 @@ for those people who are interested.
--]]
-local gsub = string.gsub
-local match = string.match
-local insert = table.insert
+local pairs = pairs
+local print = print
-- Copy files to the main CTAN release directory
function copyctan()
@@ -56,62 +55,6 @@ function copyctan()
end
end
--- Copy files to the correct places in the TDS tree
-function copytds()
- local function install(source, dest, files, tool)
- local moduledir = moduledir
- -- For material associated with secondary tools (BibTeX, MakeIndex)
- -- the structure needed is slightly different from those items going
- -- into the tex/doc/source trees
- if tool then
- -- "base" is reserved for the tools themselves: make the assumption
- -- in this case that the tdsroot name is the right place for stuff to
- -- go (really just for the team)
- if module == "base" then
- moduledir = tdsroot
- else
- moduledir = module
- end
- end
- -- Convert the file table(s) to a list of individual files
- local filenames = { }
- for _,i in ipairs(files) do
- for _,j in ipairs(i) do
- for file,_ in pairs(tree(source, j)) do
- insert(filenames, file)
- end
- end
- end
- -- The target is only created if there are actual files to install
- if next(filenames) ~= nil then
- local installdir = tdsdir .. "/" .. dest .. "/" .. moduledir
- mkdir(installdir)
- for _,i in ipairs(filenames) do
- cp(i, source, installdir)
- end
- end
- end
- install(
- docfiledir,
- "doc",
- {bibfiles, demofiles, docfiles, pdffiles, textfiles, typesetlist}
- )
- install(unpackdir, "makeindex", {makeindexfiles}, true)
- install(unpackdir, "bibtex/bst", {bstfiles}, true)
- install(sourcefiledir, "source", {sourcelist})
- install(unpackdir, "tex", {installfiles})
- install(unpackdir, "scripts", {scriptfiles}, true)
- -- Any script man files need special handling
- for _,glob in pairs(scriptmanfiles) do
- for file,_ in pairs(tree(docfiledir,glob)) do
- -- Man files should have a single-digit extension: the type
- local installdir = tdsdir .. "/doc/man/man" .. match(file,".$")
- mkdir(installdir)
- cp(file,docfiledir,installdir)
- end
- end
-end
-
-- Standard versions of the main targets for building modules
function ctan()
@@ -162,7 +105,9 @@ function ctan()
rmdir(tdsdir)
mkdir(tdsdir)
if standalone then
- errorlevel = bundlectan()
+ errorlevel = install_files(tdsdir,true)
+ if errorlevel ~=0 then return errorlevel end
+ copyctan()
else
errorlevel = call(modules, "bundlectan")
end
@@ -183,8 +128,8 @@ function ctan()
if packtdszip then
cp(ctanpkg .. ".tds.zip", tdsdir, ctandir)
end
- dirzip(ctandir, ctanpkg)
- cp(ctanpkg .. ".zip", ctandir, currentdir)
+ dirzip(ctandir, ctanzip)
+ cp(ctanzip .. ".zip", ctandir, currentdir)
else
print("\n====================")
print("Typesetting failed, zip stage skipped!")
@@ -193,53 +138,3 @@ function ctan()
return errorlevel
end
-function bundlectan()
- -- Generate a list of individual file names excluding those in the second
- -- argument: the latter is a table
- local function excludelist(include, exclude, dir)
- local include = include or { }
- local exclude = exclude or { }
- local dir = dir or currentdir
- local includelist = { }
- local excludelist = { }
- for _,i in ipairs(exclude) do
- for _,j in ipairs(i) do
- for file,_ in pairs(tree(dir, j)) do
- excludelist[file] = true
- end
- end
- end
- for _,i in ipairs(include) do
- for file,_ in pairs(tree(dir, i)) do
- if not excludelist[file] then
- insert(includelist, file)
- end
- end
- end
- return includelist
- end
- unpack()
- local errorlevel = doc()
- if errorlevel == 0 then
- -- Work out what PDF files are available
- pdffiles = { }
- for _,i in ipairs(typesetfiles) do
- insert(pdffiles, (gsub(i, "%.%w+$", ".pdf")))
- end
- -- For the purposes here, any typesetting demo files need to be
- -- part of the main typesetting list
- local typesetfiles = typesetfiles
- for _,v in pairs(typesetdemofiles) do
- insert(typesetfiles, v)
- end
- typesetlist = excludelist(typesetfiles, {sourcefiles}, docfiledir)
- sourcelist = excludelist(
- sourcefiles, {bstfiles, installfiles, makeindexfiles, scriptfiles},
- sourcefiledir
- )
- copyctan()
- copytds()
- end
- return errorlevel
-end
-