summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-07-26 20:29:50 +0000
committerKarl Berry <karl@freefriends.org>2021-07-26 20:29:50 +0000
commit6190adeb5ec3b9128a55a4add7f367f18491742b (patch)
treeba33478aa6e56e39fe01b6232cebe59578aff904 /Build
parente50d32b956ce2adb17364c5fc9eb070ba490a00a (diff)
make4ht (26jul21)
git-svn-id: svn://tug.org/texlive/trunk@60077 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/make4ht/make4ht13
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/texlive/fmtutil.pl101
2 files changed, 66 insertions, 48 deletions
diff --git a/Build/source/texk/texlive/linked_scripts/make4ht/make4ht b/Build/source/texk/texlive/linked_scripts/make4ht/make4ht
index 3ae56f049a5..d2bf27194f6 100755
--- a/Build/source/texk/texlive/linked_scripts/make4ht/make4ht
+++ b/Build/source/texk/texlive/linked_scripts/make4ht/make4ht
@@ -29,7 +29,7 @@ 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.3g"
+local version = "v0.3h"
mkparams.version_number = version
local args = mkparams.get_args()
@@ -76,6 +76,9 @@ make.params = parameters
if make:length() < 1 then
if mode == "draft" then
make:htlatex()
+ elseif mode == "clean" then
+ make:clean()
+ make.no_dvi_process = true
else
make:htlatex()
make:htlatex()
@@ -84,7 +87,7 @@ if make:length() < 1 then
end
-if not args["no-tex4ht"] then
+if not args["no-tex4ht"] and not make.no_dvi_process then
make:tex4ht()
end
@@ -92,7 +95,11 @@ local ext = args.xetex and "xdv" or "dvi"
if #make.image_patterns > 0 then
make.params.t4ht_par = make.params.t4ht_par .. " -p"
end
-make:t4ht {ext = ext}
+
+if not make.no_dvi_process then
+ make:t4ht {ext = ext}
+end
+
-- run extensions which modify the build sequence
if #extensions > 0 then
make = mkutils.extensions_modify_build(extensions, make)
diff --git a/Build/source/texk/texlive/linked_scripts/texlive/fmtutil.pl b/Build/source/texk/texlive/linked_scripts/texlive/fmtutil.pl
index 064da24f2c2..cc428c4eeeb 100755
--- a/Build/source/texk/texlive/linked_scripts/texlive/fmtutil.pl
+++ b/Build/source/texk/texlive/linked_scripts/texlive/fmtutil.pl
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# $Id: fmtutil.pl 59983 2021-07-18 22:18:08Z karl $
+# $Id: fmtutil.pl 60057 2021-07-25 18:09:03Z karl $
# fmtutil - utility to maintain format files.
# (Maintained in TeX Live:Master/texmf-dist/scripts/texlive.)
#
@@ -24,11 +24,11 @@ BEGIN {
TeX::Update->import();
}
-my $svnid = '$Id: fmtutil.pl 59983 2021-07-18 22:18:08Z karl $';
-my $lastchdate = '$Date: 2021-07-19 00:18:08 +0200 (Mon, 19 Jul 2021) $';
+my $svnid = '$Id: fmtutil.pl 60057 2021-07-25 18:09:03Z karl $';
+my $lastchdate = '$Date: 2021-07-25 20:09:03 +0200 (Sun, 25 Jul 2021) $';
$lastchdate =~ s/^\$Date:\s*//;
$lastchdate =~ s/ \(.*$//;
-my $svnrev = '$Revision: 59983 $';
+my $svnrev = '$Revision: 60057 $';
$svnrev =~ s/^\$Revision:\s*//;
$svnrev =~ s/\s*\$$//;
my $version = "r$svnrev ($lastchdate)";
@@ -432,12 +432,14 @@ sub callback_build_formats {
#
# for formats that load other formats (e.g., jadetex loads latex.fmt),
# add the current directory to TEXFORMATS, too. Currently unnecessary
- # for MFBASES and MPMEMS.
+ # for MFBASES.
$ENV{'TEXFORMATS'} ||= "";
$ENV{'TEXFORMATS'} = "$tmpdir$sep$ENV{TEXFORMATS}";
- # switch to temporary directory for format generation
- $opts{"dry-run"} || chdir($tmpdir)
+ # switch to temporary directory for format generation; on the other hand,
+ # for -n, the tmpdir won't exist, but we don't want to find a spurious
+ # tex.fmt in the cwd. Probably won't be such things in /.
+ chdir($opts{"dry-run"} ? "/" : $tmpdir)
|| die "Cannot change to directory $tmpdir: $!";
# we rebuild formats in two rounds:
@@ -772,63 +774,72 @@ sub rebuild_one_format {
. "$prgswitch $texargs";
print_verbose("running \`$cmdline' ...\n");
- {
- my $texpool = $ENV{'TEXPOOL'};
- if ($localpool) {
- $ENV{'TEXPOOL'} = cwd() . $sep . ($texpool ? $texpool : "");
- }
+ my $texpool = $ENV{'TEXPOOL'};
+ if ($localpool) {
+ $ENV{'TEXPOOL'} = cwd() . $sep . ($texpool ? $texpool : "");
+ }
- # in mktexfmtMode we must redirect *all* output to stderr
- $cmdline .= " >&2" if $mktexfmtMode;
- $cmdline .= " <$nul";
- my $retval = system("$DRYRUN$cmdline");
-
- # report error if it failed.
- if ($retval != 0) {
- $retval /= 256 if ($retval > 0);
- print_deferred_error("running \`$cmdline' return status: $retval\n");
- }
+ # in mktexfmtMode we must redirect *all* output to stderr
+ $cmdline .= " >&2" if $mktexfmtMode;
+ $cmdline .= " <$nul";
+ my $retval = system("$DRYRUN$cmdline");
- # Copy the log file after the program is run, so that the log file
- # is available to inspect even on failure. So we need the dest dir tree.
- TeXLive::TLUtils::mkdirhier($destdir) if ! $opts{"dry-run"};
- #
+ # report error if it failed.
+ if ($retval != 0) {
+ $retval /= 256 if ($retval > 0);
+ print_deferred_error("running \`$cmdline' return status: $retval\n");
+ }
+
+ # Copy the log file after the program is run, so that the log file
+ # is available to inspect even on failure. So we need the dest dir tree.
+ TeXLive::TLUtils::mkdirhier($destdir) if ! $opts{"dry-run"};
+ #
+ if ($opts{"dry-run"}) {
+ print_info("would copy log file to: $destdir/$logfile\n");
+ } else {
# Here and in the following we use copy instead of move
# to make sure that in SElinux enabled cases the rules of
# the destination directory are applied.
# See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=900580
+ #
if (TeXLive::TLUtils::copy("-f", $logfile, "$destdir/$logfile")) {
print_info("log file copied to: $destdir/$logfile\n");
} else {
- print_deferred_error("cannot copy log $logfile to: $destdir\n")
- unless $opts{"dry-run"};
+ print_deferred_error("failed to copy log $logfile to: $destdir\n");
}
+ }
- # original shell script did *not* check the return value
- # we keep this behavior, but add an option --strict that
- # errors out on all failures.
- if ($retval != 0 && $opts{'strict'}) {
- print_deferred_error("returning error due to option --strict\n");
- return $FMT_FAILURE;
- }
+ # original shell script did *not* check the return value
+ # we keep this behavior, but add an option --strict that
+ # errors out on all failures.
+ if ($retval != 0 && $opts{'strict'}) {
+ print_deferred_error("returning error due to option --strict\n");
+ return $FMT_FAILURE;
+ }
- if ($localpool) {
- if ($texpool) {
- $ENV{'TEXPOOL'} = $texpool;
- } else {
- delete $ENV{'TEXPOOL'};
- }
+ if ($localpool) {
+ if ($texpool) {
+ $ENV{'TEXPOOL'} = $texpool;
+ } else {
+ delete $ENV{'TEXPOOL'};
}
}
+ # if this was a dry run, we don't expect anything to have been
+ # created, so there's nothing to inspect or copy. Call it good.
+ if ($opts{"dry-run"}) {
+ print_info("dry run, so returning success: $fmtfile\n");
+ return $FMT_SUCCESS;
+ }
+
# check and install of fmt and log files
- if (! -f $fmtfile) {
- print_deferred_error("\`$cmdline' failed (no $fmtfile)\n");
+ if (! -s $fmtfile) {
+ print_deferred_error("no (or empty) $fmtfile made by: $cmdline\n");
return $FMT_FAILURE;
}
if (! -f $logfile) {
- print_deferred_error("no log file generated for $fmt/$eng, strange\n");
+ print_deferred_error("no log file generated for: $fmt/$eng\n");
return $FMT_FAILURE;
}
@@ -1243,7 +1254,7 @@ sub determine_config_files {
# returns 1 if actually saved due to changes
sub save_fmtutil {
my $fn = shift;
- return if $opts{'dry-run'};
+ return 0 if $opts{'dry-run'};
my %fmtf = %{$alldata->{'fmtutil'}{$fn}};
if ($fmtf{'changed'}) {
TeXLive::TLUtils::mkdirhier(dirname($fn));