diff options
author | Karl Berry <karl@freefriends.org> | 2019-11-01 21:00:21 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-11-01 21:00:21 +0000 |
commit | fdb7d0585af6b9054e895d6f3047766f799b6098 (patch) | |
tree | 59e8b2c6971d1fb91d08250283dfa74589869d2d /Build/source | |
parent | 1eea7ddd33803c5945bc4b2b2654c960d42aa0c2 (diff) |
make4ht (1nov19)
git-svn-id: svn://tug.org/texlive/trunk@52603 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rwxr-xr-x | Build/source/texk/texlive/linked_scripts/make4ht/make4ht | 32 | ||||
-rwxr-xr-x | Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl | 50 |
2 files changed, 45 insertions, 37 deletions
diff --git a/Build/source/texk/texlive/linked_scripts/make4ht/make4ht b/Build/source/texk/texlive/linked_scripts/make4ht/make4ht index 564bc6e7a04..b1ff84f7006 100755 --- a/Build/source/texk/texlive/linked_scripts/make4ht/make4ht +++ b/Build/source/texk/texlive/linked_scripts/make4ht/make4ht @@ -3,8 +3,10 @@ -- This package is subject of LPPL license, version 1.3 kpse.set_program_name("luatex") - - +-- logging should be globally available +logging = require "make4ht-logging" +if os.type == "windows" then logging.use_colors = false end +local log = logging.new("make4ht") local make4ht = require("make4ht-lib") local lapp = require("lapp-mk4") local mkutils = require("mkutils") @@ -13,7 +15,7 @@ local mk_config = require("make4ht-config") -- args string is here just as sample, we dont pass it it to -- mkparams.get_args() so default args string is used local args = [[ -make4ht - build system for tex4ht +make4ht - build system for TeX4ht Usage: make4ht [options] filename ["tex4ht.sty op." "tex4ht op." "t4ht op" "latex op"] -c,--config (default xhtml) Custom config file @@ -27,13 +29,16 @@ make4ht [options] filename ["tex4ht.sty op." "tex4ht op." "t4ht op" "latex op"] -- set version number. the template should be replaced by the -- actual version number by the build script -local version = "v0.2g" +local version = "v0.3" mkparams.version_number = version local args = mkparams.get_args() local parameters = mkparams.process_args(args) +log:status("Conversion started") +log:status("Input file: " .. parameters.tex_file) + local mode = parameters.mode local build_file = parameters.build_file @@ -48,7 +53,7 @@ if allowed_output_formats[ output_format ] then else -- load html5 as default output format if output_format then - print("Cannot load output format: ".. output_format) + log:warning("Cannot load output format: ".. output_format) end formatter = mkutils.load_output_format("html5") end @@ -56,7 +61,7 @@ end local configname = "make4ht" local conffile = mk_config.find_config(configname) or mk_config.find_xdg_config(configname) if conffile then - print("Using configuration file: " .. conffile) + log:info("Using configuration file: " .. conffile) mkutils.load_config(parameters, conffile) end local extensions = formatter.prepare_extensions(parameters.extensions) @@ -96,15 +101,26 @@ end -- allow output formats to modify the build process at the end make = formatter.modify_build(make) or make +make:match("tmp$", function(filename,params) + -- remove the temporary tex file created when the input comes from the standard input + if params.is_tmp_file then + log:info("removing temp file", params.tex_file) + os.remove(params.tex_file) + end + -- prevent copying of the temporary file to the outdir + return false,"tmp file" end +) -make:match("tmp$", function() return false,"tmp file" end) make:match(".*",function(filename,par) local outdir = '' --par["outdir"] and par["outdir"] .."/" or '' if par['outdir'] ~= "" then outdir = par['outdir'] .. '/' end - print("outdir: "..outdir) + log:info("outdir: "..outdir) local outfilename = outdir .. filename mkutils.copy(filename,outfilename) return true end) make:run() + +log:status("Conversion finished") + diff --git a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl index 81e9936a951..447bca1ea77 100755 --- a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl +++ b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl @@ -1,12 +1,12 @@ #!/usr/bin/env perl -# $Id: tlmgr.pl 52467 2019-10-20 22:10:34Z karl $ +# $Id: tlmgr.pl 52585 2019-10-31 18:26:15Z karl $ # # Copyright 2008-2019 Norbert Preining # This file is licensed under the GNU General Public License version 2 # or any later version. -my $svnrev = '$Revision: 52467 $'; -my $datrev = '$Date: 2019-10-21 00:10:34 +0200 (Mon, 21 Oct 2019) $'; +my $svnrev = '$Revision: 52585 $'; +my $datrev = '$Date: 2019-10-31 19:26:15 +0100 (Thu, 31 Oct 2019) $'; my $tlmgrrevision; my $tlmgrversion; my $prg; @@ -1095,10 +1095,9 @@ sub backup_and_remove_package { } if ($opts{"backup"}) { $tlp->make_container($::progs{'compressor'}, $localtlpdb->root, - destdir => $opts{"backupdir"}, - containername => "${pkg}.r" . $tlp->revision, - relative => $tlp->relocated, - user => 1); + $opts{"backupdir"}, + "${pkg}.r" . $tlp->revision, + $tlp->relocated); if ($autobackup) { # in case we do auto backups we remove older backups clear_old_backups($pkg, $opts{"backupdir"}, $autobackup); @@ -1888,7 +1887,8 @@ sub setup_backup_directory { # finally, if we have --backupdir, but no --backup, just enable it $opts{"backup"} = 1 if $opts{"backupdir"}; - info("$prg: saving backups to $opts{'backupdir'}\n") + my $saving_verb = $opts{"dry-run"} || $opts{"list"} ? "would save" :"saving"; + info("$prg: $saving_verb backups to $opts{'backupdir'}\n") if $opts{"backup"} && !$::machinereadable; return ($ret, $autobackup); @@ -2161,18 +2161,17 @@ sub action_backup { # for now default to xz and allow overriding with env var my $compressorextension = $Compressors{$::progs{'compressor'}}{'extension'}; my $tlp = $localtlpdb->get_package($pkg); - info("saving current status of $pkg to $opts{'backupdir'}/${pkg}.r" . - $tlp->revision . ".tar.$compressorextension\n"); + my $saving_verb = $opts{"dry-run"} ? "would save" : "saving"; + info("$saving_verb current status of $pkg to $opts{'backupdir'}/${pkg}.r" + . $tlp->revision . ".tar.$compressorextension\n"); if (!$opts{"dry-run"}) { $tlp->make_container($::progs{'compressor'}, $localtlpdb->root, - destdir => $opts{"backupdir"}, - containername => "${pkg}.r" . $tlp->revision, - user => 1); + $opts{"backupdir"}, "${pkg}.r" . $tlp->revision); } } } info("no action taken due to --dry-run\n") if $opts{"dry-run"}; - # TODO_ERRORCHECKING neets checking of the above + # TODO_ERRORCHECKING needs checking of the above return ($F_OK); } @@ -2283,10 +2282,7 @@ sub write_w32_updater { push (@rst_info, "$pkg ^($oldrev^)"); next if ($opts{"dry-run"}); # create backup; make_container expects file name in a format: some-name.r[0-9]+ - my ($size, undef, $fullname) = $localtlp->make_container("tar", $root, - destdir => $temp, - containername => "__BACKUP_$pkg.r$oldrev", - user => 1); + my ($size, undef, $fullname) = $localtlp->make_container("tar", $root, $temp, "__BACKUP_$pkg.r$oldrev"); if ($size <= 0) { tlwarn("$prg: Creation of backup container of $pkg failed.\n"); return 1; # backup failed? abort @@ -2873,7 +2869,7 @@ sub action_update { machine_line("-ret", $pkg, $FLAG_REVERSED_UPDATE, $rev, $mediarev, "-", "-", "-", @addargs); } else { if ($opts{"list"}) { - # not issueing anything if we keep a package + # not issuing anything if we keep a package upd_info($pkg, -1, $rev, $mediarevstr, "keep"); } } @@ -3206,10 +3202,8 @@ sub action_update { if ($opts{"backup"} && !$opts{"dry-run"}) { my $compressorextension = $Compressors{$::progs{'compressor'}}{'extension'}; $tlp->make_container($::progs{'compressor'}, $root, - destdir => $opts{"backupdir"}, - containername => "${pkg}.r" . $tlp->revision, - relative => $tlp->relocated, - user => 1); + $opts{"backupdir"}, "${pkg}.r" . $tlp->revision, + $tlp->relocated); $unwind_package = "$opts{'backupdir'}/${pkg}.r" . $tlp->revision . ".tar.$compressorextension"; @@ -3247,11 +3241,9 @@ sub action_update { # no backup was made, so let us create a temporary .tar file # of the package my $tlp = $localtlpdb->get_package($pkg); - my ($s, undef, $fullname) = $tlp->make_container("tar", $root, - destdir => $temp, - containername => "__BACKUP_${pkg}.r" . $tlp->revision, - relative => $tlp->relocated, - user => 1); + my ($s, undef, $fullname) = $tlp->make_container("tar", $root, $temp, + "__BACKUP_${pkg}.r" . $tlp->revision, + $tlp->relocated); if ($s <= 0) { tlwarn("\n$prg: Creation of backup container of $pkg failed.\n"); tlwarn("$prg: Continuing to update other packages, please retry...\n"); @@ -9921,7 +9913,7 @@ This script and its documentation were written for the TeX Live distribution (L<https://tug.org/texlive>) and both are licensed under the GNU General Public License Version 2 or later. -$Id: tlmgr.pl 52467 2019-10-20 22:10:34Z karl $ +$Id: tlmgr.pl 52585 2019-10-31 18:26:15Z karl $ =cut # test HTML version: pod2html --cachedir=/tmp tlmgr.pl >/tmp/tlmgr.html |