diff options
author | Karl Berry <karl@freefriends.org> | 2018-03-08 23:45:11 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-03-08 23:45:11 +0000 |
commit | 64ee185d962cd13195e329ab4ac8a9da6535b677 (patch) | |
tree | 652f96f04e1826a75ef1c3a38ab3d2a72ff9c067 /Build | |
parent | a502f321bf373ab83e239389e55d622e6c6980e2 (diff) |
l3build now cmdline script (9mar18)
git-svn-id: svn://tug.org/texlive/trunk@46894 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
4 files changed, 150 insertions, 0 deletions
diff --git a/Build/source/texk/texlive/linked_scripts/Makefile.am b/Build/source/texk/texlive/linked_scripts/Makefile.am index b9611f0a98e..fc690d65b94 100644 --- a/Build/source/texk/texlive/linked_scripts/Makefile.am +++ b/Build/source/texk/texlive/linked_scripts/Makefile.am @@ -133,6 +133,7 @@ texmf_other_scripts = \ kotex-utils/jamo-normalize.pl \ kotex-utils/komkindex.pl \ kotex-utils/ttf2kotexfont.pl \ + l3build/l3build.lua \ latex-git-log/latex-git-log \ latex-papersize/latex-papersize.py \ latex2man/latex2man \ diff --git a/Build/source/texk/texlive/linked_scripts/Makefile.in b/Build/source/texk/texlive/linked_scripts/Makefile.in index fb41af59f35..1818e57408b 100644 --- a/Build/source/texk/texlive/linked_scripts/Makefile.in +++ b/Build/source/texk/texlive/linked_scripts/Makefile.in @@ -347,6 +347,7 @@ texmf_other_scripts = \ kotex-utils/jamo-normalize.pl \ kotex-utils/komkindex.pl \ kotex-utils/ttf2kotexfont.pl \ + l3build/l3build.lua \ latex-git-log/latex-git-log \ latex-papersize/latex-papersize.py \ latex2man/latex2man \ diff --git a/Build/source/texk/texlive/linked_scripts/l3build/l3build.lua b/Build/source/texk/texlive/linked_scripts/l3build/l3build.lua new file mode 100644 index 00000000000..cb8a6d674cb --- /dev/null +++ b/Build/source/texk/texlive/linked_scripts/l3build/l3build.lua @@ -0,0 +1,145 @@ +--[[ + +File l3build.lua Copyright (C) 2014-2017 The LaTeX3 Project + +It may be distributed and/or modified under the conditions of the +LaTeX Project Public License (LPPL), either version 1.3c of this +license or (at your option) any later version. The latest version +of this license is in the file + + http://www.latex-project.org/lppl.txt + +This file is part of the "l3build bundle" (The Work in LPPL) +and all files in that bundle must be distributed together. + +----------------------------------------------------------------------- + +The development version of the bundle can be found at + + https://github.com/latex3/l3build + +for those people who are interested. + +--]] + +-- Version information +release_date = "2018-03-08" + +-- File operations are aided by the LuaFileSystem module +local lfs = require("lfs") + +-- Local access to functions + +local assert = assert +local ipairs = ipairs +local lookup = kpse.lookup +local match = string.match +local next = next +local print = print +local select = select +local tonumber = tonumber +local exit = os.exit + +-- l3build setup and functions +kpse.set_program_name("kpsewhich") +build_kpse_path = string.match(lookup("l3build.lua"),"(.*[/])") +local function build_require(s) + require(lookup("l3build-"..s..".lua", { path = build_kpse_path } ) ) +end + +-- Minimal code to do basic checks +build_require("arguments") +build_require("help") + +-- Filter out special cases early +if options["target"] == "help" then + help() + exit(0) +elseif options["target"] == "version" then + version() + exit(0) +end + +build_require("file-functions") +build_require("typesetting") +build_require("aux") +build_require("clean") +build_require("check") +build_require("ctan") +build_require("install") +build_require("unpack") +build_require("manifest") +build_require("manifest-setup") +build_require("tagging") +build_require("stdmain") + +-- Allow main function to be disabled 'higher up' +main = main or stdmain + +-- Load configuration file if running as a script +if match(arg[0], "l3build(%.lua)$") then + -- Look for some configuration details + if fileexists("build.lua") then + dofile("build.lua") + else + print("Error: Cannot find configuration build.lua") + exit(1) + end +end + +-- Load standard settings for variables: +-- comes after any user versions +build_require("variables") + +-- Tidy up the epoch setting +-- Force an epoch if set at the command line +-- Must be done after loading variables, etc. +if options["epoch"] then + epoch = options["epoch"] + forcecheckepoch = true + forcedocepoch = true +end +normalise_epoch() + +-- Sanity check +check_engines() + +-- +-- Deal with multiple configs for tests +-- + +-- When we have specific files to deal with, only use explicit configs +-- (or just the std one) +if options["names"] then + checkconfigs = options["config"] or {stdconfig} +else + checkconfigs = options["config"] or checkconfigs +end + +if options["target"] == "check" then + if #checkconfigs > 1 then + local errorlevel = 0 + local opts = options + for i = 1, #checkconfigs do + opts["config"] = {checkconfigs[i]} + errorlevel = call({"."}, "check", opts) + if errorlevel ~= 0 then exit(1) end + end + -- Avoid running the 'main' set of tests twice + exit(0) + end +end +if #checkconfigs == 1 and + checkconfigs[1] ~= "build" and + (options["target"] == "check" or options["target"] == "save") then + local config = "./" .. checkconfigs[1] .. ".lua" + if fileexists(config) then + dofile(config) + else + print("Error: Cannot find configuration " .. checkconfigs[1]) + exit(1) + end +end + +-- Call the main function +main(options["target"], options["names"]) diff --git a/Build/source/texk/texlive/linked_scripts/scripts.lst b/Build/source/texk/texlive/linked_scripts/scripts.lst index b0e8852880f..212205f921e 100644 --- a/Build/source/texk/texlive/linked_scripts/scripts.lst +++ b/Build/source/texk/texlive/linked_scripts/scripts.lst @@ -77,6 +77,7 @@ jfmutil/jfmutil.pl kotex-utils/jamo-normalize.pl kotex-utils/komkindex.pl kotex-utils/ttf2kotexfont.pl +l3build/l3build.lua latex-git-log/latex-git-log latex-papersize/latex-papersize.py latex2man/latex2man @@ -150,6 +151,8 @@ texlive/updmap.pl texliveonfly/texliveonfly.py texloganalyser/texloganalyser thumbpdf/thumbpdf.pl +tlcockpit/tlcockpit.sh +tlshell/tlshell.tcl ulqda/ulqda.pl urlbst/urlbst vpe/vpe.pl |