texlive[60251] trunk: light-latex-make (15aug21)

commits+karl at tug.org commits+karl at tug.org
Sun Aug 15 22:26:36 CEST 2021


Revision: 60251
          http://tug.org/svn/texlive?view=revision&revision=60251
Author:   karl
Date:     2021-08-15 22:26:35 +0200 (Sun, 15 Aug 2021)
Log Message:
-----------
light-latex-make (15aug21)

Modified Paths:
--------------
    trunk/Build/source/texk/texlive/linked_scripts/light-latex-make/llmk.lua
    trunk/Master/texmf-dist/doc/man/man1/llmk.1
    trunk/Master/texmf-dist/doc/man/man1/llmk.man1.pdf
    trunk/Master/texmf-dist/doc/support/light-latex-make/LICENSE
    trunk/Master/texmf-dist/doc/support/light-latex-make/README.md
    trunk/Master/texmf-dist/doc/support/light-latex-make/llmk.pdf
    trunk/Master/texmf-dist/doc/support/light-latex-make/llmk.tex
    trunk/Master/texmf-dist/scripts/light-latex-make/llmk.lua

Modified: trunk/Build/source/texk/texlive/linked_scripts/light-latex-make/llmk.lua
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/light-latex-make/llmk.lua	2021-08-15 20:26:15 UTC (rev 60250)
+++ trunk/Build/source/texk/texlive/linked_scripts/light-latex-make/llmk.lua	2021-08-15 20:26:35 UTC (rev 60251)
@@ -3,7 +3,7 @@
 --
 -- This is file `llmk.lua'.
 --
--- Copyright 2018-2020 Takuto ASAKURA (wtsnjp)
+-- Copyright 2018-2021 Takuto ASAKURA (wtsnjp)
 --   GitHub:   https://github.com/wtsnjp
 --   Twitter:  @wtsnjp
 --
@@ -39,8 +39,8 @@
 
 -- program information
 M.prog_name = 'llmk'
-M.version = '0.2.0'
-M.copyright = 'Copyright 2018-2020'
+M.version = '1.0.0'
+M.copyright = 'Copyright 2018-2021'
 M.author = 'Takuto ASAKURA (wtsnjp)'
 M.llmk_toml = 'llmk.toml'
 
@@ -57,11 +57,13 @@
   bibtex = {'string', 'bibtex'},
   clean_files = {'[string]', {
     '%B.aux', '%B.bbl', '%B.bcf', '%B-blx.bib', '%B.blg', '%B.fls',
-    '%B.idx', '%B.ilg', '%B.log', '%B.out', '%B.run.xml', '%B.toc'
+    '%B.idx', '%B.ilg', '%B.ind', '%B.log', '%B.nav', '%B.out',
+    '%B.run.xml', '%B.snm', '%B.toc', '%B.vrb',
   }},
   clobber_files = {'[string]', {'%B.dvi', '%B.pdf', '%B.ps', '%B.synctex.gz'}},
   dvipdf = {'string', 'dvipdfmx'},
   dvips = {'string', 'dvips'},
+  extra_clean_files = {'[string]', {}},
   latex = {'string', 'lualatex'},
   llmk_version = {'string', nil},
   makeindex = {'string', 'makeindex'},
@@ -169,9 +171,13 @@
   helper(table, 2)
 end
 
--- return the filename if exits, even if the ".tex" extension is omitted
--- otherwise return nil
-local lfs = require("lfs")
+function M.get_status(raw)
+  if os.type == 'windows' then
+    return raw
+  else
+    return raw / 256
+  end
+end
 
 -- Replace config param to filename
 function M.replace_specifiers(str, source, target)
@@ -303,6 +309,13 @@
       major, minor, given_major, given_minor)
   end
 
+  -- warn if the given mojor version is older than this program
+  if given_major < major then
+    llmk.util.err_print('warning',
+      'The specified llmk_version (v%d.%d) is older than this program (v%d.%d)',
+      given_major, given_minor, major, minor)
+  end
+
   -- Note: no breaking change has been made (yet)
 end
 
@@ -848,7 +861,13 @@
       end
     else
       if toml_field then
-        toml = toml .. string.match(l, '^%s*%%%s*(.-)%s*$') .. '\n'
+        local match = string.match(l, '^%s*%%%s*(.-)%s*$')
+        if match == nil then
+          llmk.util.err_print('error', 'Encounter invalid line in TOML field')
+          os.exit(llmk.const.exit_error)
+        else
+          toml = toml .. match .. '\n'
+        end
       end
     end
 
@@ -1232,10 +1251,12 @@
   end
 
   -- call and check the status
-  local status = os.execute(cmd)
-  if status > 0 then
+  -- Note: os.execute() returns values 256 multiples of actual status
+  --       except on Windows
+  local cmd_status = llmk.util.get_status(os.execute(cmd))
+  if cmd_status > 0 then
     llmk.util.err_print('error',
-      'Fail running %s (exit code: %d)', cmd, status)
+      'Fail running %s (exit code: %d)', cmd, cmd_status)
     os.exit(llmk.const.exit_failure)
   end
 
@@ -1327,6 +1348,7 @@
 function M.clean(fn, config)
   llmk.util.err_print('info', 'Begining cleaning for "%s"', fn)
   replace_spec_and_remove_files(config.clean_files, fn)
+  replace_spec_and_remove_files(config.extra_clean_files, fn)
 end
 
 -- the actual process for the --clobber action
@@ -1333,6 +1355,7 @@
 function M.clobber(fn, config)
   llmk.util.err_print('info', 'Begining clobbering for "%s"', fn)
   replace_spec_and_remove_files(config.clean_files, fn)
+  replace_spec_and_remove_files(config.extra_clean_files, fn)
   replace_spec_and_remove_files(config.clobber_files, fn)
 end
 

Modified: trunk/Master/texmf-dist/doc/man/man1/llmk.1
===================================================================
--- trunk/Master/texmf-dist/doc/man/man1/llmk.1	2021-08-15 20:26:15 UTC (rev 60250)
+++ trunk/Master/texmf-dist/doc/man/man1/llmk.1	2021-08-15 20:26:35 UTC (rev 60251)
@@ -1,7 +1,7 @@
 .\" generated with Ronn/v0.7.3
 .\" http://github.com/rtomayko/ronn/tree/0.7.3
 .
-.TH "LLMK" "1" "October 2020" "llmk 0.2.0" "llmk manual"
+.TH "LLMK" "1" "August 2021" "llmk 1.0.0" "llmk manual"
 .
 .SH "NAME"
 \fBllmk\fR \- Light LaTeX Make
@@ -86,7 +86,7 @@
 Source: \fIhttps://github\.com/wtsnjp/llmk\fR
 .
 .SH "COPYRIGHT"
-Copyright 2018\-2020 Takuto ASAKURA (wtsnjp)\.
+Copyright 2018\-2021 Takuto ASAKURA (wtsnjp)\.
 .
 .br
 License: The MIT License \fIhttps://opensource\.org/licenses/mit\-license\fR\.

Modified: trunk/Master/texmf-dist/doc/man/man1/llmk.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/support/light-latex-make/LICENSE
===================================================================
--- trunk/Master/texmf-dist/doc/support/light-latex-make/LICENSE	2021-08-15 20:26:15 UTC (rev 60250)
+++ trunk/Master/texmf-dist/doc/support/light-latex-make/LICENSE	2021-08-15 20:26:35 UTC (rev 60251)
@@ -1,6 +1,6 @@
 The MIT License (MIT)
 
-Copyright 2018-2020 Takuto ASAKURA (wtsnjp)
+Copyright 2018-2021 Takuto ASAKURA (wtsnjp)
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal

Modified: trunk/Master/texmf-dist/doc/support/light-latex-make/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/support/light-latex-make/README.md	2021-08-15 20:26:15 UTC (rev 60250)
+++ trunk/Master/texmf-dist/doc/support/light-latex-make/README.md	2021-08-15 20:26:35 UTC (rev 60251)
@@ -1,7 +1,7 @@
 ![llmk: The Light LaTeX Make](./llmk-logo.png)
 
-[![Build Status](https://travis-ci.org/wtsnjp/llmk.svg?branch=master)](https://travis-ci.org/wtsnjp/llmk)
-[![Build status](https://ci.appveyor.com/api/projects/status/1papc7m85kl9iph1?svg=true)](https://ci.appveyor.com/project/wtsnjp/llmk)
+[![CI](https://github.com/wtsnjp/llmk/actions/workflows/ci.yml/badge.svg)](https://github.com/wtsnjp/llmk/actions/workflows/ci.yml)
+[![CTAN](https://img.shields.io/ctan/v/light-latex-make?color=FC02FF&label=CTAN)](https://www.ctan.org/pkg/light-latex-make)
 
 This is yet another build tool for LaTeX documents. The features of **llmk** are:
 
@@ -14,7 +14,7 @@
 
 ## Installation
 
-This software is included in [TeX Live](https://www.tug.org/texlive/) as Package `light-latex-make`. If you are using the latest TeX Live, you normally don't need to install it by yourself (please use the `tlmgr` command to install it, if the package is missing).
+This software is included in [TeX Live](https://www.tug.org/texlive/) and [MiKTeX](https://miktex.org/) as Package `light-latex-make`. If you are using one of the latest distributions, you normally don't need to install it by yourself (for TeX Live, please use the `tlmgr` command to install it, if the package is missing).
 
 In case the package is not installed in your TeX system or you want to use the latest (development) version of the program, you have to install it manually. You can acquire any material related to this software from [our GitHub repository](https://github.com/wtsnjp/llmk). The installation procedure is very simple anyway because the `llmk.lua` is the standalone executable. Running `texlua <path>/llmk.lua` should work in any case. In UNIX-like systems, the easiest way to install the program is copy or symlink the file `llmk.lua` as `llmk` in any place in the `PATH`.
 
@@ -49,23 +49,6 @@
 
 You can find other example LaTeX document files in the [examples](https://github.com/wtsnjp/llmk/tree/master/examples) directory.
 
-### Action Clean/Clobber
-
-Similar to [latexmk](http://personal.psu.edu/jcc8/software/latexmk/), Actions `--clean` (`-c`) and `--clobber` (`-C`) are available.
-
-* The `--clean` action removes temporary files such as `*.aux` and `*.log`.
-* The `--clobber` action removes all generated files including final PDFs.
-
-Specifically,
-
-```
-$ llmk --clean FILE...
-```
-
-removes files generated by the specified `FILE`s. Files removed by these actions can be customized.
-
-## Advanced Usage
-
 ### Using llmk.toml
 
 Alternatively, you can write your build settings in an independent file named `llmk.toml` (this file name is fixed).
@@ -123,6 +106,23 @@
 
 Note that this magic comment is effective **only on the first line** of a LaTeX source file. Note also that if a TOML field exist in the file, the TOML field has higher priority and all the other magic comments will be ignored.
 
+### Action Clean/Clobber
+
+Similar to [latexmk](http://personal.psu.edu/jcc8/software/latexmk/), Actions `--clean` (`-c`) and `--clobber` (`-C`) are available.
+
+* The `--clean` action removes temporary files such as `*.aux` and `*.log`.
+* The `--clobber` action removes all generated files including final PDFs.
+
+Specifically,
+
+```
+$ llmk --clean FILE...
+```
+
+removes files generated by the specified `FILE`s. In case you omit the argument `FILE`, files generated by the `source` files are removed. In both case, the files to remove by these actions can be customized (see the reference manual for the details).
+
+## Advanced Usage
+
 ### Custom compile sequence
 
 You can setup custom sequence for processing LaTeX documents; use `sequence` key to specify the order of programs to process the documents and specify the detailed settings for each program.
@@ -162,14 +162,15 @@
 The following is the list of available TOML keys in llmk. See the reference manual for the details.
 
 * `bibtex` (type: *string*, default: `"bibtex"`)
-* `clean_files` (type: *string* or *array of strings*, default: `["%B.aux", "%B.log", "%B.toc", "%B.out", "%B.bbl", "%B.bcf", "%B.blg", "%B-blx.bib", "%B.idx", "%B.ilg", "%B.fls", "%B.run.xml"]`)
+* `clean_files` (type: *string* or *array of strings*, default: `["%B.aux", "%B.bbl", "%B.bcf", "%B-blx.bib", "%B.blg", "%B.fls", "%B.idx", "%B.ilg", "%B.ind", "%B.log", "%B.nav", "%B.out", "%B.run.xml", "%B.snm", "%B.toc", "%B.vrb"]`)
 * `clobber_files` (type: *string* or *array of strings*, default: `["%B.pdf", "%B.dvi", "%B.ps", "%B.synctex.gz"]`)
 * `dvipdf` (type: *string*, default: `"dvipdfmx"`)
 * `dvips` (type: *string*, default: `"dvips"`)
+* `extra_clean_files` (type: *string* or *array of strings*, default: `[]`)
 * `latex` (type: *string*, default: `"lualatex"`)
 * `llmk_version` (type: *string*)
 * `makeindex` (type: *string*, default: `"makeindex"`)
-* `max_repeat` (type: *integer*, default: 5)
+* `max_repeat` (type: *integer*, default: `5`)
 * `programs` (type: *table*)
 	* \<program name\>
 		* `args` (type: *string* or *array of strings*, default: `["%T"]`)
@@ -176,7 +177,7 @@
 		* `aux_file` (type: *string*)
 		* `aux_empty_size` (type: *integer*)
 		* `command` (type: *string*, **required**)
-		* `generated_target` (type: *boolean*, default: false)
+		* `generated_target` (type: *boolean*, default: `false`)
 		* `opts` (type: *string* or *array of strings*)
 		* `postprocess` (type: *string*)
 		* `target` (type: *string*, default: `"%S"`)
@@ -227,7 +228,7 @@
 
 * [Reference manual](http://mirrors.ctan.org/support/light-latex-make/llmk.pdf): it describes the full specification.
 * [Talk in TUG 2020](https://www.youtube.com/watch?v=kzqlNHKmzBo): the author talked about the design concept with a demonstration.
-* [TUGboat article](https://tug.org/members/TUGboat/tb41-2/tb128asakura-llmk.pdf): the post-proceedings of the above talk. (currently TUG member access only)
+* [TUGboat article](https://www.tug.org/TUGboat/tb41-2/tb128asakura-llmk.pdf): the post-proceedings of the above talk.
 
 ## Acknowledgements
 
@@ -235,7 +236,7 @@
 
 ## License
 
-Copyright 2018-2020 Takuto ASAKURA ([wtsnjp](https://twitter.com/wtsnjp))
+Copyright 2018-2021 Takuto ASAKURA ([wtsnjp](https://twitter.com/wtsnjp))
 
 This software is licensed under [the MIT license](./LICENSE).
 

Modified: trunk/Master/texmf-dist/doc/support/light-latex-make/llmk.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/support/light-latex-make/llmk.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/light-latex-make/llmk.tex	2021-08-15 20:26:15 UTC (rev 60250)
+++ trunk/Master/texmf-dist/doc/support/light-latex-make/llmk.tex	2021-08-15 20:26:35 UTC (rev 60251)
@@ -10,7 +10,7 @@
 \title{llmk: Light {\LaTeX} Make}
 \author{Takuto Asakura (wtsnjp)}
 \subtitle{Reference Manual}
-\date{v0.2.0\quad\today}
+\date{v1.0.0\quad\today}
 \keywords{llmk, build-tool, toml, lua, luatex}
 
 \begin{document}
@@ -38,11 +38,10 @@
 
 \subsection{Installation}
 
-This software is included in {\TeX} Live as Package \code{light-latex-make}. If
-you have the latest {\TeX} Live, you normally don't need to install it by
-yourself. If you want to install the development version, please refer to our
-{\README}.
-% TODO: mention MiKTeX when ready
+This software is included in {\TeX} Live and MiK{\TeX} as Package
+\code{light-latex-make}. If you have one of the latest distributions, you
+normally don't need to install it by yourself. If you want to install the
+development version, please refer to our {\README}.
 
 \subsection{Learning \prog{llmk}}
 
@@ -84,11 +83,10 @@
 If you do not want to use GitHub for some reasons, it is also fine to directly
 send an email to the author (\email{tkt.asakura at gmail.com}).
 
-The \prog{llmk} program is currently version \code{0.x} and still growing in
-any aspect. At this moment, requests for new features are also welcome; the
-author cannot promise to implement the requested features, but will happy to
-take them into account. Before making a request, it is strongly recommended to
-read the article about the design concept~\cite{asakura2020}.
+Requests for new features are also welcome; the author cannot promise to
+implement the requested features, but will happy to take them into account.
+Before making a request, it is strongly recommended to read the article about
+the design concept~\cite{asakura2020}.
 
 \section{Command-line interface}
 
@@ -158,7 +156,8 @@
 
 \begin{clopt}{\sopt{c}, \lopt{clean}}
 Removes temporary files such as \code{aux} and \code{log} files. The files
-removed with this action can be customized with the key \ckey{clean\_files}.
+removed with this action can be customized with keys \ckey{clean\_files} and
+\ckey{extra\_clean\_files}.
 \end{clopt}
 
 \begin{clopt}{\sopt{C}, \lopt{clobber}}
@@ -396,7 +395,8 @@
 \begin{htcode}
 [
   "%B.aux", "%B.bbl", "%B.bcf", "%B-blx.bib", "%B.blg", "%B.fls",
-  "%B.idx", "%B.ilg", "%B.log", "%B.out", "%B.run.xml", "%B.toc"
+  "%B.idx", "%B.ilg", "%B.ind", "%B.log", "%B.nav", "%B.out",
+  "%B.run.xml", "%B.snm", "%B.toc", "%B.vrb"
 ]
 \end{htcode}
 \end{confkey}
@@ -425,6 +425,13 @@
 ineffective.
 \end{confkey}
 
+\begin{confkey}{extra\_clean\_files}{type: \type{array of strings}}
+  [default: \code{[]}]
+Extra files to be removed with the cleaning action (\lopt{clean}). By using
+this key, you can easily add files to be removed on top of the default
+\ckey{clean\_files}.
+\end{confkey}
+
 \begin{confkey}{latex}{type: \type{string}}[default: \code{"lualatex"}]
 The command to use for the \progname{latex} program. Internally, this key is an
 alias for the \ckey{command} key in the \progname{latex} entry. If the

Modified: trunk/Master/texmf-dist/scripts/light-latex-make/llmk.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/light-latex-make/llmk.lua	2021-08-15 20:26:15 UTC (rev 60250)
+++ trunk/Master/texmf-dist/scripts/light-latex-make/llmk.lua	2021-08-15 20:26:35 UTC (rev 60251)
@@ -3,7 +3,7 @@
 --
 -- This is file `llmk.lua'.
 --
--- Copyright 2018-2020 Takuto ASAKURA (wtsnjp)
+-- Copyright 2018-2021 Takuto ASAKURA (wtsnjp)
 --   GitHub:   https://github.com/wtsnjp
 --   Twitter:  @wtsnjp
 --
@@ -39,8 +39,8 @@
 
 -- program information
 M.prog_name = 'llmk'
-M.version = '0.2.0'
-M.copyright = 'Copyright 2018-2020'
+M.version = '1.0.0'
+M.copyright = 'Copyright 2018-2021'
 M.author = 'Takuto ASAKURA (wtsnjp)'
 M.llmk_toml = 'llmk.toml'
 
@@ -57,11 +57,13 @@
   bibtex = {'string', 'bibtex'},
   clean_files = {'[string]', {
     '%B.aux', '%B.bbl', '%B.bcf', '%B-blx.bib', '%B.blg', '%B.fls',
-    '%B.idx', '%B.ilg', '%B.log', '%B.out', '%B.run.xml', '%B.toc'
+    '%B.idx', '%B.ilg', '%B.ind', '%B.log', '%B.nav', '%B.out',
+    '%B.run.xml', '%B.snm', '%B.toc', '%B.vrb',
   }},
   clobber_files = {'[string]', {'%B.dvi', '%B.pdf', '%B.ps', '%B.synctex.gz'}},
   dvipdf = {'string', 'dvipdfmx'},
   dvips = {'string', 'dvips'},
+  extra_clean_files = {'[string]', {}},
   latex = {'string', 'lualatex'},
   llmk_version = {'string', nil},
   makeindex = {'string', 'makeindex'},
@@ -169,9 +171,13 @@
   helper(table, 2)
 end
 
--- return the filename if exits, even if the ".tex" extension is omitted
--- otherwise return nil
-local lfs = require("lfs")
+function M.get_status(raw)
+  if os.type == 'windows' then
+    return raw
+  else
+    return raw / 256
+  end
+end
 
 -- Replace config param to filename
 function M.replace_specifiers(str, source, target)
@@ -303,6 +309,13 @@
       major, minor, given_major, given_minor)
   end
 
+  -- warn if the given mojor version is older than this program
+  if given_major < major then
+    llmk.util.err_print('warning',
+      'The specified llmk_version (v%d.%d) is older than this program (v%d.%d)',
+      given_major, given_minor, major, minor)
+  end
+
   -- Note: no breaking change has been made (yet)
 end
 
@@ -848,7 +861,13 @@
       end
     else
       if toml_field then
-        toml = toml .. string.match(l, '^%s*%%%s*(.-)%s*$') .. '\n'
+        local match = string.match(l, '^%s*%%%s*(.-)%s*$')
+        if match == nil then
+          llmk.util.err_print('error', 'Encounter invalid line in TOML field')
+          os.exit(llmk.const.exit_error)
+        else
+          toml = toml .. match .. '\n'
+        end
       end
     end
 
@@ -1232,10 +1251,12 @@
   end
 
   -- call and check the status
-  local status = os.execute(cmd)
-  if status > 0 then
+  -- Note: os.execute() returns values 256 multiples of actual status
+  --       except on Windows
+  local cmd_status = llmk.util.get_status(os.execute(cmd))
+  if cmd_status > 0 then
     llmk.util.err_print('error',
-      'Fail running %s (exit code: %d)', cmd, status)
+      'Fail running %s (exit code: %d)', cmd, cmd_status)
     os.exit(llmk.const.exit_failure)
   end
 
@@ -1327,6 +1348,7 @@
 function M.clean(fn, config)
   llmk.util.err_print('info', 'Begining cleaning for "%s"', fn)
   replace_spec_and_remove_files(config.clean_files, fn)
+  replace_spec_and_remove_files(config.extra_clean_files, fn)
 end
 
 -- the actual process for the --clobber action
@@ -1333,6 +1355,7 @@
 function M.clobber(fn, config)
   llmk.util.err_print('info', 'Begining clobbering for "%s"', fn)
   replace_spec_and_remove_files(config.clean_files, fn)
+  replace_spec_and_remove_files(config.extra_clean_files, fn)
   replace_spec_and_remove_files(config.clobber_files, fn)
 end
 



More information about the tex-live-commits mailing list.