summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-07-25 18:09:03 +0000
committerKarl Berry <karl@freefriends.org>2021-07-25 18:09:03 +0000
commit368728d968dd75b237fd69bc3e4d21b6503e96dc (patch)
treec0a0a44065dca2d7f8d1f31885a40e3aa4ded5d7
parent67bab1444fb849ae3225b5674bba43ecc68c0f83 (diff)
no need for extra block just for $texpool declaration?
git-svn-id: svn://tug.org/texlive/trunk@60057 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-xMaster/texmf-dist/scripts/texlive/fmtutil.pl77
1 files changed, 38 insertions, 39 deletions
diff --git a/Master/texmf-dist/scripts/texlive/fmtutil.pl b/Master/texmf-dist/scripts/texlive/fmtutil.pl
index ba00242710d..b2c21473b04 100755
--- a/Master/texmf-dist/scripts/texlive/fmtutil.pl
+++ b/Master/texmf-dist/scripts/texlive/fmtutil.pl
@@ -774,55 +774,54 @@ 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 ($opts{"dry-run"}) {
- print_info("would copy log file to: $destdir/$logfile\n");
+ #
+ if (TeXLive::TLUtils::copy("-f", $logfile, "$destdir/$logfile")) {
+ print_info("log file copied to: $destdir/$logfile\n");
} else {
- if (TeXLive::TLUtils::copy("-f", $logfile, "$destdir/$logfile")) {
- print_info("log file copied to: $destdir/$logfile\n");
- } else {
- print_deferred_error("failed to copy log $logfile to: $destdir\n");
- }
+ 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'};
}
}