summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/l3build
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-09-24 20:23:18 +0000
committerKarl Berry <karl@freefriends.org>2018-09-24 20:23:18 +0000
commita495fe970496337011c0698a03476ce888a26105 (patch)
tree592b35bc873870f28ec4883e3ba0fdd6a4d68119 /Master/texmf-dist/scripts/l3build
parent68966bb4bfd52e8d9d91b9fd5e6ff36d3d74a57e (diff)
l3 (24sep18)
git-svn-id: svn://tug.org/texlive/trunk@48749 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/l3build')
-rw-r--r--Master/texmf-dist/scripts/l3build/l3build-check.lua8
-rw-r--r--Master/texmf-dist/scripts/l3build/l3build-ctan.lua14
-rw-r--r--Master/texmf-dist/scripts/l3build/l3build-install.lua32
-rw-r--r--Master/texmf-dist/scripts/l3build/l3build-typesetting.lua7
-rw-r--r--Master/texmf-dist/scripts/l3build/l3build-variables.lua1
-rwxr-xr-xMaster/texmf-dist/scripts/l3build/l3build.lua14
6 files changed, 65 insertions, 11 deletions
diff --git a/Master/texmf-dist/scripts/l3build/l3build-check.lua b/Master/texmf-dist/scripts/l3build/l3build-check.lua
index e59f6ca7e54..1c20067d9b6 100644
--- a/Master/texmf-dist/scripts/l3build/l3build-check.lua
+++ b/Master/texmf-dist/scripts/l3build/l3build-check.lua
@@ -30,6 +30,9 @@ local output = io.output
local rnd = math.random
+local var_value = kpse.var_value
+local set_program_name = kpse.set_program_name
+
local luatex_version = status.luatex_version
local len = string.len
@@ -726,6 +729,8 @@ function runtest(name, engine, hide, ext, pdfmode, breakout)
break
end
end
+ -- Deal with TEXMFCNF
+ set_program_name("kpsewhich")
-- Clean out any dynamic files
for _,filetype in pairs(dynamicfiles) do
rm(testdir,filetype)
@@ -741,6 +746,9 @@ function runtest(name, engine, hide, ext, pdfmode, breakout)
-- Avoid spurious output from (u)pTeX
os_setenv .. " GUESS_INPUT_KANJI_ENCODING=0"
.. os_concat ..
+ -- Allow for local texmf files
+ os_setenv .. " TEXMFCNF=." .. os_pathsep .. var_value("TEXMFCNF")
+ .. os_concat ..
(forcecheckepoch and setepoch() or "") ..
-- Ensure lines are of a known length
os_setenv .. " max_print_line=" .. maxprintline
diff --git a/Master/texmf-dist/scripts/l3build/l3build-ctan.lua b/Master/texmf-dist/scripts/l3build/l3build-ctan.lua
index f1e0757e9b0..b256ce21403 100644
--- a/Master/texmf-dist/scripts/l3build/l3build-ctan.lua
+++ b/Master/texmf-dist/scripts/l3build/l3build-ctan.lua
@@ -25,6 +25,9 @@ for those people who are interested.
local pairs = pairs
local print = print
+local lower = string.lower
+local match = string.match
+
-- Copy files to the main CTAN release directory
function copyctan()
mkdir(ctandir .. "/" .. ctanpkg)
@@ -129,6 +132,17 @@ function ctan()
cp(i, j, tdsdir .. "/doc/" .. tdsroot .. "/" .. bundle)
end
end
+ -- Rename README if necessary
+ if ctanreadme ~= "" and not match(lower(ctanreadme),"^readme%.%w+") then
+ local newfile = "README." .. match(ctanreadme,"%.(%w+)$")
+ for _,dir in pairs({ctandir .. "/" .. ctanpkg,
+ tdsdir .. "/doc/" .. tdsroot .. "/" .. bundle}) do
+ if fileexists(dir .. "/" .. ctanreadme) then
+ rm(dir,newfile)
+ ren(dir,ctanreadme,newfile)
+ end
+ end
+ end
dirzip(tdsdir, ctanpkg .. ".tds")
if packtdszip then
cp(ctanpkg .. ".tds.zip", tdsdir, ctandir)
diff --git a/Master/texmf-dist/scripts/l3build/l3build-install.lua b/Master/texmf-dist/scripts/l3build/l3build-install.lua
index 88ac5bad6f3..12c59914916 100644
--- a/Master/texmf-dist/scripts/l3build/l3build-install.lua
+++ b/Master/texmf-dist/scripts/l3build/l3build-install.lua
@@ -29,6 +29,7 @@ local set_program = kpse.set_program_name
local var_value = kpse.var_value
local gsub = string.gsub
+local lower = string.lower
local match = string.match
local insert = table.insert
@@ -132,14 +133,6 @@ function install_files(target,full,dry_run)
end
local errorlevel = unpack()
if errorlevel ~= 0 then return errorlevel end
- errorlevel = install_files(unpackdir,"tex",{installfiles})
- + install_files(unpackdir,"bibtex/bst",{bstfiles},module,true)
- + install_files(unpackdir,"makeindex",{makeindexfiles},module,true)
- + install_files(unpackdir,"scripts",{scriptfiles},module)
- if errorlevel ~= 0 then return errorlevel end
- if full then
- errorlevel = doc()
- if errorlevel ~= 0 then return errorlevel end
-- Creates a 'controlled' list of files
local function excludelist(dir,include,exclude)
@@ -165,6 +158,11 @@ function install_files(target,full,dry_run)
return includelist
end
+ local installlist = excludelist(unpackdir,installfiles,{scriptfiles})
+
+ if full then
+ errorlevel = doc()
+ if errorlevel ~= 0 then return errorlevel end
-- For the purposes here, any typesetting demo files need to be
-- part of the main typesetting list
local typesetfiles = typesetfiles
@@ -188,6 +186,16 @@ function install_files(target,full,dry_run)
{bibfiles,demofiles,docfiles,pdffiles,textfiles,typesetlist})
if errorlevel ~= 0 then return errorlevel end
+ -- Rename README if necessary
+ if not dry_run then
+ if ctanreadme ~= "" and not match(lower(ctanreadme),"^readme%.%w+") then
+ local installdir = target .. "/doc/" .. moduledir
+ if fileexists(installdir .. "/" .. ctanreadme) then
+ ren(installdir,ctanreadme,"README." .. match(ctanreadme,"%.(%w+)$"))
+ end
+ end
+ end
+
-- Any script man files need special handling
local manfiles = { }
for _,glob in pairs(scriptmanfiles) do
@@ -210,6 +218,14 @@ function install_files(target,full,dry_run)
end
end
end
+
+ if errorlevel ~= 0 then return errorlevel end
+
+ errorlevel = install_files(unpackdir,"tex",{installlist})
+ + install_files(unpackdir,"bibtex/bst",{bstfiles},module,true)
+ + install_files(unpackdir,"makeindex",{makeindexfiles},module,true)
+ + install_files(unpackdir,"scripts",{scriptfiles},module)
+
return errorlevel
end
diff --git a/Master/texmf-dist/scripts/l3build/l3build-typesetting.lua b/Master/texmf-dist/scripts/l3build/l3build-typesetting.lua
index 71fe0ea6c4b..9f732f7fab4 100644
--- a/Master/texmf-dist/scripts/l3build/l3build-typesetting.lua
+++ b/Master/texmf-dist/scripts/l3build/l3build-typesetting.lua
@@ -29,6 +29,9 @@ for those people who are interested.
local gsub = string.gsub
local match = string.match
+local var_value = kpse.var_value
+local set_program_name = kpse.set_program_name
+
function dvitopdf(name, dir, engine, hide)
if match(engine, "^u?ptex$") then
run(
@@ -52,11 +55,15 @@ end
-- An auxiliary used to set up the environmental variables
function runtool(subdir, dir, envvar, command)
+ set_program_name("kpsewhich")
dir = dir or "."
return(
run(
typesetdir .. "/" .. subdir,
(forcedocepoch and setepoch() or "") ..
+ -- Allow for local texmf files
+ os_setenv .. " TEXMFCNF=." .. os_pathsep .. var_value("TEXMFCNF")
+ .. os_concat ..
os_setenv .. " " .. envvar .. "=." .. os_pathsep
.. abspath(localdir) .. os_pathsep
.. abspath(dir .. "/" .. subdir)
diff --git a/Master/texmf-dist/scripts/l3build/l3build-variables.lua b/Master/texmf-dist/scripts/l3build/l3build-variables.lua
index f24b11acb3a..b3b999755dd 100644
--- a/Master/texmf-dist/scripts/l3build/l3build-variables.lua
+++ b/Master/texmf-dist/scripts/l3build/l3build-variables.lua
@@ -159,6 +159,7 @@ end
-- Other required settings
asciiengines = asciiengines or {"pdftex"}
checkruns = checkruns or 1
+ctanreadme = ctanreadme or "README.md"
ctanzip = ctanzip or ctanpkg .. "-ctan"
epoch = epoch or 1463734800
if flatten == nil then
diff --git a/Master/texmf-dist/scripts/l3build/l3build.lua b/Master/texmf-dist/scripts/l3build/l3build.lua
index d97fecd8298..827d3856a74 100755
--- a/Master/texmf-dist/scripts/l3build/l3build.lua
+++ b/Master/texmf-dist/scripts/l3build/l3build.lua
@@ -25,7 +25,7 @@ for those people who are interested.
--]]
-- Version information
-release_date = "2018-09-21"
+release_date = "2018-09-23"
-- File operations are aided by the LuaFileSystem module
local lfs = require("lfs")
@@ -137,9 +137,16 @@ if options["target"] == "check" then
end
end
if next(failed) then
- print(" Failed tests for configs:")
for _,config in ipairs(failed) do
- print(" - " .. config)
+ print("Failed tests for configuration " .. config .. ":")
+ print("\n Check failed with difference files")
+ if failed ~= "build" then
+ local testdir = testdir .. "-" .. failed
+ end
+ for _,i in ipairs(filelist(testdir,"*" .. os_diffext)) do
+ print(" - " .. testdir .. "/" .. i)
+ end
+ print("")
end
exit(1)
else
@@ -154,6 +161,7 @@ if #checkconfigs == 1 and
local config = "./" .. checkconfigs[1] .. ".lua"
if fileexists(config) then
dofile(config)
+ testdir = testdir .. "-" .. checkconfigs[1]
else
print("Error: Cannot find configuration " .. checkconfigs[1])
exit(1)